为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

一种节能型网络交换机的设计毕业论文

2018-04-25 50页 doc 528KB 12阅读

用户头像

is_496339

暂无简介

举报
一种节能型网络交换机的设计毕业论文一种节能型网络交换机的设计毕业论文 题 目 一种节能型网络交换机的设计 学生姓名 胡嘉成 学号 1113014137 所在学院 物理与电信工程学院 专业班级 电 子1104 指导教师 李 菊 叶 完成地点 博远楼微机实验室 2014 年 5 月 28 日 毕业论文,设计,任务书 院(系) 物电学院 专业班级 电子信息工程1104 学生姓名 胡嘉成 一、毕业论文,设计,题目 一种节能型网络交换机的设计 二、毕业论文,设计,工作自 2015 年 3月10 日 起至 2015 年 6 月 20 日止 三、毕业论文,...
一种节能型网络交换机的设计毕业论文
一种节能型网络交换机的毕业论文 题 目 一种节能型网络交换机的设计 学生姓名 胡嘉成 学号 1113014137 所在学院 物理与电信工程学院 专业班级 电 子1104 指导教师 李 菊 叶 完成地点 博远楼微机实验室 2014 年 5 月 28 日 毕业论文,设计,任务书 院(系) 物电学院 专业班级 电子信息工程1104 学生姓名 胡嘉成 一、毕业论文,设计,题目 一种节能型网络交换机的设计 二、毕业论文,设计,工作自 2015 年 3月10 日 起至 2015 年 6 月 20 日止 三、毕业论文,设计,进行地点: 物电学院计算机信息处理分室 四、毕业论文,设计,的内容要求: 1、本次毕业设计要求如下: 随着网络的进一步普及和应用需求的提升,交换机使用数量急剧增加。相对于一台交换机,所 使用的电能也许不算太大,几十台乃至上百台,甚至更多,这样所耗费的电能就不容忽视,研究节 能型网络交换机已经迫在眉睫。 本设计要求学生利用单片机对无线发射模块进行控制,在不同信号控制下,可以向无线接收模 块发射不同的信号,然后通过接受模块控制继电器的通断,开启关闭交换机的电源,从而达到远程 控制的目的。另外,利用单片机内部定时器,实现对交换机的定时控制,可以有效的节省电能,延 长交换机的使用寿命,提高交换机的使用效率。 2、毕业设计成果要求: 测试结果和论文,论文要求计算机打印(A4纸),论文有不少于3000词的相关英文中文翻译。 3、毕业设计时间安排: 1—4周:查阅相关资料,熟悉题目内容,完成系统需求分析、相关硬件及软件环境的选择。 提交开题报告; 5—10周:熟练掌握单片机的工作原理,以及相关的软件仿真软件,给出具体的设计。 11—12周:做出实物一套,进一步完善硬件系统功能,整理资料; 13—14周:毕业设计验收; 15—16周:撰写、修改、提交毕业论文,毕业答辩。 指 导 教 师 系(教 研 室) 系(教研室)主任签名 批准日期 接受论文 (设计)任务开始执行日期 学生签名 陕西理工学院毕业设计 一种节能型网络交换机的设计 胡嘉成 (陕西理工学院物理与电信工程学院电子信息工程专业,2011级4班,陕西 汉中 723003) 指导教师:李菊叶 [摘要]本设计主要以单片机STC89C52RC为核心~设计了一款节能型网络交换机。该系统利用时钟芯片DS1302及无线数据收发芯片NRF24L01~可实现信号采集、数据显示、键盘控制、无线收发等功能。并利用单片机对无线发射模块进行控制~发射不同的信号~再由接收模块操控继电器的通断~开关交换机的电源~从而达到远程控制的目的~可以有效的节约电能~提高交换机的使用效率~并延长交换机的使用寿命。 [关键词]节能型,远程;定时,STC89C52RC,控制 陕西理工学院毕业设计 A design of energy-saving network switches Hu Jiacheng (Grade 11,Class 4,Major electronics and information engineering~School of Physics and Telecommunication Engineering~Shaanxi University of Technology~Hanzhong 723003~Shaanxi) Tutor: Li Juye Abstract: This design realized an energy-saving network switches ,which was based on STC89C52RC .The system make use of the clock chip DS1302 and wireless data transceiver chip nRF24L01, to realize the signal acquisition, data display, keyboard control, wireless transmitting and receiving function. And using MCU to control the wireless transmitting module, by transmitting different signals to the wireless receiving module, and then by the receiving module control relay on-off, open the power of network switches, in order to achieve the purpose of remote control, to avoid the waste of electric energy,then we can effectively save electricity, and extend the service life of the switch, improve the efficiency of the use of the switches. Keywords: energy-saving ; remote; timing; STC89C52RC; control 陕西理工学院毕业设计 目录 1.绪论 .................................................... 1 1.1引言 ................................................ 1 1.2研究背景 ............................................. 1 1.3发展前景 ............................................. 1 1.4应用领域 ............................................. 2 2. 总体方案 ............................................... 3 2.1系统的总体方案设计 ................................... 3 2.2 发送机的设计方案 ..................................... 3 2.3 接收机的设计方案 ..................................... 3 3.硬件芯片介绍 ............................................ 4 3.1 单片机STC89C52 ...................................... 4 3.1.1 STC89C52功能特点 ................................ 4 3.1.2 STC89C52各管脚介绍 .............................. 4 3.2 DS1302时钟芯片 ...................................... 6 3.2.1 引脚功能及结构 .................................. 6 3.2.2 DS1302的控制字节 ................................ 7 3.2.3 数据输入输出(I/O) ............................... 7 3.2.4 DS1302的寄存器.................................. 7 3.3 液晶显示屏LCD1602 ................................... 7 3.3.1 LCD1602特点说明................................. 7 3.3.2 LCD1602功能介绍................................. 7 3.3.3 LCD1602初始化过程 ............................... 9 3.4 无线NRF24L01芯片 .................................... 9 3.5 参数存储AT24C02芯片 ................................. 9 4.系统的硬件架构 ......................................... 10 4.1 USB电源模块 ........................................ 10 4.2 单片机最小系统 ...................................... 10 4.2.1晶振电路 ....................................... 10 - I - 陕西理工学院毕业设计 4.2.2复位电路 ....................................... 10 4.2.3最小系统整体图 ................................. 12 4.2.4 无线信号感应电路 ............................... 12 4.3 无线收发模块........................................ 12 4.4 时钟模块 ........................................... 13 4.5 液晶显示模块........................................ 13 4.6 按键模块 ........................................... 14 4.7参数存储模块 ........................................ 14 4.8 继电器输出电路设计 .................................. 14 5.系统的软件设计 ......................................... 15 5.1开发语言和开发环境 .................................. 15 5.2系统软件的总体说明 .................................. 15 5.3 软件设计总体流程图 .................................. 16 5.4 按键输入模块........................................ 17 5.5 液晶显示模块........................................ 17 5.6 时钟处理程序........................................ 17 5.7 参数存储模块........................................ 18 6.系统测试及数据分析 ..................................... 18 6.1距离测试 ........................................... 19 6.2自动开关机模式测试 .................................. 19 6.3手动控制模式测试 .................................... 19 6.4多通路模式 .......................................... 19 结论 ..................................................... 20 致谢 ..................................................... 21 参考文献 ................................................. 22 附录A 英文文献及其翻译 ................................... 23 附录B 系统电路仿真原理图 ................................. 39 附录C PCB版图仿真图 ..................................... 41 附录D 电路实物图 ......................................... 42 -II- 陕西理工学院毕业设计 1.绪论 1.1引言 随着科技的发展和社会的进步,人们逐渐开始关注节能减排和可持续发展。随之而来的就是各种节能产品如雨后春笋般出现在大众视野中。当前,绝大多数交换机为实现节能,都是提升其智能化功能,通过其流量多寡而设置交换机开关时间段。但有时软件后台工作仍无法避免使用流量,导致厂家这一功能形同虚设,没有起到节能作用,反而因为检测软件的运行,导致交换机耗电量加剧,发热增加,缩短其使用寿命。所以设计一种可控制交换机开关的电路是十分有必要的。而为了更方便简洁的操作,减少出入机房的次数,该设计采用了NRF24L01无线收发芯片,可以实现即使在另一个房间,也能无障碍的实现对机房中网络交换机的开关操作。 本设计是基于单片机的电路系统,由发送器和接收器这二部分构成,收发部分都是用单片机STC89C52 为核心模块、以 NRF24L01 为无线数据收发芯片,在LCD1602上显示正式时间,使用键盘设置开关时间,应用单片机的定时中断功能进行定时控制,并通过NRF24L01芯片将信号发送给接收部分,接收端在定时时间到达时控制继电器闭合,通过LED 灯实现信号的反馈。如果对该系统加以开发利用,可在到家门口时,控制家电开关工作,实现智能化家居生活;也可方便使用者找到日常生活中常用的一些出门需要经常携带,而回家后又总会随手丢放的物品,如钱包、钥匙、手机等。 此装置其实用到的就是弱电控制强电的原理,用一对1.5V电池便可以控制220V的交流电压,保障了我们的人身安全,使我们避免直接与强电打交道,达到无需接触就能沟通的效果,让你用电更加安全和方便。 1.2研究背景 国内有华为系列和研华工业生产的节能型交换机。在国外,富士通和D-link品牌的节能交换机比较著名。 华为系列的交换机使用的中控芯片是具有自主知识产权的,实现了按依据流量多寡来调整使用功率。当设备感知到业务流量减少或者部分端口没有流量产生的时候,将会降低芯片的转发功耗,或者直接使端口进入休眠状态,等到有流量值触发时,就会重启端口转发流量。而且它还拥有智能化的电源管理,可以降低通信设备的功耗。 研华工业的交换机对没有数据通讯的端口能够自动识别,而对闲置的端口,则会选择切断电源,从而实现节能。 D-link交换机包含环保节能技术,能够免费检测计算机的开关情况,如果在线的计算机关机,相对应的端口会被交换机自动转换到待机模式,从而减少能源消耗,并且还降低产品运行产生的热能,还可大幅度延长设备的生命周期。还可以自动检测电缆的长度,并提供相应的用于工作的电量,大幅度降低能源消耗,就能达到环境保护和节约能源的目的,同时还能帮助用户降低“不必要的”的消费,降低使用的成本。 富士通网络交换机使用的是SFP+屏蔽双绞线铜电缆线,每个端口仅仅会消耗5W电源。还有能 自动的电源配置技术,用来降低总体电量消耗。 确保组织机构仅使用所需求电量的 总之,无论是什么品牌的交换机都是通过智能化电源管理和自动控制的方法来实现节能减耗的,这与本设计中使用单片机来组成外围电路的思路是相似的,但是在本设计中加入了手动按键和无线模块,实现了远程控制,增加了可操作性,在一定意义上方便了电源管理,提高了网络交换机的实用性,实现了节能的目的。 1.3发展前景 作为一种可远程和定时控制电源的开关控制电路,其发展前景还是十分可观的。通过对单片机的深入编程,可以设计出适合不同情况(例如上网、看视频、打游戏和下载等使用不同流量比例)的电源模式,满足不同的控制需求。随着单片机技术的发展,远程控制电路在未来就可以用遥控器,甚至手机来设置模式,更加方便也更加节能。 第 1 页 共 51 页 陕西理工学院毕业设计 该设计因为适用性广泛,可靠性强,可应用于各种场合中不同型号的交换机的控制,特别是学校机房、通讯企业网络中心和小区基站等大功耗场所,对节能减耗有显著效果。 1.4应用领域 在本设计中,以单片机为核心的无线开关控制电路实现了网络路由器的节能,但是这只是它的一个应用。在生活中,我们可以有更多的使用方法,比如说我们将它的分机设计成为一款可接收信号的插座,将主机设计成为遥控器(或是将它集成在手机上,用app控制),那我们在家里无论是什么电器,只要连在特殊插座上,只需要按一个按钮,就能控制任何电器的开关。 而在工作中,这种电路也有用武之地。如将其用于日常测试机台在突发情况下的故障,方便工程师分析,以便在真实故障中找准问题,一次性解决,减少不必要的经济损失。而在一些诸如煤矿或石油的高危工作场所,在发生瓦斯泄露等危险时,拥有一个无线远程开关(阀门)控制系统的情况下,可以最大可能的减少人员和经济损失。 第 2 页 共 51 页 陕西理工学院毕业设计 2.总体方案 2.1系统的总体方案设计 本电路由由发送器和接收器二部件构成,收发部分皆以单片机为中心,用以解决收发信息,发送端运用键盘输入时间,需要能显示时钟的部件,以方便操作。并使用无线装置将信号送给接收器,接收端则通过无线芯片接收信号,通过单片机处理后,显示高低电位,操控继电器的通断,用LED 灯亮灭实现信号的反馈。总体系统设计结构框图如下图2.1。 2.2 发送机的设计方案 该部分电路应设计要求,应包含按键、时间显示、存储、无线发射等模块。通过设计,首先发送机应利用单片机本身芯片的功能,配合一些简单的元器件(如晶振、按键和电容等),构成单片机最小系统。还应具备时间设置,实时时间显示,以及最重要的在指定时间向接收器发送指定信号的功能。 2.3 接收机的设计方案 该部分的设计,相较发射机的电路而言,比较简单。首先它也需要单片机最小系统,然后它应该要一个无线信号感应器,通过发光二极管与单片机相连,显示无线信号是否联通;无线接收模块也必不可少,接收到的信号通过单片机处理,要达到控制交流电的目的,我们还需要继电器驱动电路,电机电路,以达到强电控制弱电的功能。 液晶显示 复 位 电 时 路 单片机 钟 继电交换无线 电 无器 机 接收 按路 线键发 设射 无线 交换继电置 接收 机 器 图2.1 系统结构框图 第 3 页 共 51 页 陕西理工学院毕业设计 3.硬件芯片介绍 3.1 单片机STC89C52 3.1.1 STC89C52功能特点 STC89C52是一种带8K字节闪动可编程可擦除只读存储器的低电压,性能高的COMOS8的微 处理器,称为单片机。该器件采用ATMEL高密度非易失存储器制造技术制造,与工业标准的MCS-51[1] 指令集和输出管脚相兼容。表3.1给出了其主要功能。 表3.1 STC89C52主要功能 主要功能特性 兼容MCS51指令系统 8K可反复擦写Flash ROM 32个双向I/O口 256x8bit内部RAM 3个16位可编程定时/计数器中断 时钟频率0.24MHz 2个串行中断 可编程UART串行通道 2个外部中断源 共6个中断源 2个读写中断口线 3级加密位 低功耗空闲和掉电模式 软件设置睡眠和唤醒功能 3.1.2 STC89C52各管脚介绍 STC89C52各管脚如图3.1所示。 3.1 STC89C52管脚图 (1)主电源引脚(2根) VCC(Pin40):电源输入,接,5V电源 GND(Pin20):接地线 (2)外接晶振引脚(2根) XTAL0(Pin18):片内振荡电路的输入端 XTAL1(Pin19):片内振荡电路的输出端 第 4 页 共 51 页 陕西理工学院毕业设计 (3)控制引脚(4根) RST/VPP(Pin9):复位引脚,引脚上有2个机器周期的高电平,可以使单片机复位。 ALE/PROG(Pin30):地址锁存允许信号 PSEN(Pin29):外部存储器读选通信号 EA/VPP(Pin31):程序存储器的内外部选通,当接低电平时,从外部程序存储器读指令;如果接高电平,就从内部程序存储器读指令。 (4)可编程输入/输出引脚(32根) STC89C52单片机有4组8位的可编程I/O口,分别为P0-P3口,每个口有8根引脚,共有32根。 PO口(Pin39,Pin32):名称为P0.0,P0.7。P0口是一个8位的双向I/O口。 作为电路输出口,每一位都能驱动8个逻辑电平(晶体管.晶体管逻辑电平)。 P1口(Pin1,Pin8):名称为P1.0,P1.7。P1 口是一个8 位双向I/O 口,它具备内部上拉电阻,p1 输出缓冲器,是能驱动四 个 TTL 逻辑电平。在P1 端口写“1”时,内部有上拉电阻,会把端口拉高,此时能作为输入口使用。而作为输入口使用时,由于内部电阻的原因,被外部拉低的引脚将输出电流(TTL)。此外,定时器/计数器2将由P1.0和P1.2充当,外部计数输入(P1.0/T2)和时器/计数器2 的触发输入(P1.1/T2EX),具体如下所示。P1口 在flash编程和校验时,接收低[2]8位地址字节。 P1引脚第二功能 P1.0 :T2(定时器/计数器T2的外部计数输入),时钟输出 P1.1 :T2EX(定时器/计数器T2的捕捉/重载触发信号和方向控制) P1.5: MOSI(在线系统编程时用到) P1.6 :MISO(在线系统编程时用到) P1.7 :SCK(在线系统编程时用到) P2口(Pin21,Pin28):名称为P2.0,P2.7。P2 口是一个的8 位双向I/O 口,它具有内部上拉的电阻,4 个 TTL 逻辑电平都由P2 输出缓冲器驱动。对P2 端口写“1”时,端口被内部上拉电阻拉高,此时可以作为输入口使用。而作为输入端使用时,由于内部电阻的原因,被外部拉低的引脚将输出电流(IIL)。在用16位地址读取外部数据存储器(例如执行MOVX @DPTR)或访问外部程序存储器时,高八位地址被P2 口送出。在这种应用中,会使用很强的内部上拉,并用P2 口发送1。在使用 8位地址(如MOVX @RI)访问外部数据存储器时,P2锁存器的内容由P2口输出。[2]在flash编写和验证时,高8位地址字节和一些控制信号也被P2口接收到。 P3口(Pin10,Pin17):8位准双向I/O口线,名称为P3.0,P3.7。P3 口是也一个的8 位双向I/O 口,同时具有内部上拉的电阻,4 个 TTL 逻辑电平都由p2 输出缓冲器驱动。对P3 端口写“1”时,此时它可以作为输入口使用,而且内部上拉电阻会把端口拉高。作为输入使用时,由于内部电阻的原因,被外部拉低的引脚,将输出电流(IIL)。 作为STC89C52特殊功能(第二功能),P3[3]口也可这样使用,如下表所示。在flash编写程序和校正检验时,P3口也会接收一些控制信号。 第二功能 端口引脚 P3.0 RXD(串行输入口) P3.1 TXD(串行输出口) P3.2 INTO(外中断0) P3.3 INT1(外中断1) P3.4 TO(定时/计数器0) P3.5 T1(定时/计数器1) P3.6 WR(外部数据存储器写选通) P3.7 RD(外部数据存储器读选通) 另外,一些用于FLASH闪存编程和程序校验的控制信号也会用P3口接收。 RST——复位输入。当振荡器开始工作时,两个机器周期以上高电平会出现在RST引脚上,这 第 5 页 共 51 页 陕西理工学院毕业设计 将使单片机复位。 ALE/PROG——当在访问数据存储器或外部程序存储器时,地址的低8位字节用ALE(地址锁存允许)输出脉冲锁存。一般情况下,ALE输出固定的脉冲信号,其大小为时钟振荡频率的1/6,因[4]此对外输出时钟或用于定时目的就会用到它。要注意的是:每次在访问外部数据存储器时侯,都会跳过一个ALE脉冲。 在编程FLASH存储器期间,输入编程脉冲(PROG)还会使用该引脚。 在必要的情况下,要禁止ALE操作,可通过对D0位置位来实现,其中D0位位于特殊功能寄存器(SFR)区中的8EH单元。该位置位后,想将ALE激活,只有一条MOVX和MOVC指令才能实现。此外,它会微弱的拉高该引脚,应设置ALE禁止位无效,当单片机执行外部程序。 PSEN——外部程序存储器的读选通信号是程序储存允许(PSEN)输出,在单片机由外部程序存储器取数据(或指令)时,在每个机器周期,各有两次PSEN的有效,即在输出两个脉冲期间,将[5]跳过两次PSEN信号,每当访问外部数据存储器的时候。 EA/VPP——是外部访问的允许,欲使外部程序存储器(地址为0000H.FFFFH)仅被CPU访问,保持低电平(接地)是EA端必须保持的状态。需注意的是:如果在编程加密位LB1,内部会锁存EA端状态,每当复位的时侯。如EA端接Vcc端(为高电平),内部程序存储器的指令被CPU执行。 在编程FLASH存储器的时候,加上+12V的编程地该引脚允许电源Vpp,当然这必须是使用12V编程电压Vpp于该器件。 3.2 DS1302时钟芯片 为了实现无线控制计时和定时等功能,此设计采用了DS1302实时时钟芯片。美国DALLAS公司推出的DS1302 是一种高性能、带RAM、低功耗的实时时钟电路,它具有闰年补偿功能,可以对[6]星期、时、分、秒、年、月、日进行计时,工作电压为3.5V,5.5V。同步通信采用三线接口与CPU进行,并可一次传送多个字节的RAM数据或时钟信号,其中采用突发方式。DS1302内部有一个用于临时性存放数据的31×8的RAM寄存器。DS1302与DS1202兼容,是DS1202的升级产品,但增加了后背电源/主电源双电源引脚,同时提供了一种新的能力,那就是对后背电源进行涓细电流充电。 3.2.1 引脚功能及结构 在DS1302的引脚中,VCC2为主电源,Vcc1为后备电源。在关闭主电源的情况下,也能保持连续运行时钟。DS1302由Vcc2或Vcc1两者中的较大者供电。当Vcc1,0.2V小于Vcc2时,DS1302由Vcc2供电。当Vcc2小于Vcc1时,DS1302由Vcc1供电。振荡源是X1和X2,由32.768kHz晶振外接。复位/片选线是RST管脚,把RST输入驱动置高电平,所有的数据传送可以被启动。RST输入有两种功能:首先,允许地址/命令序列送入移位寄存器,当RST接通控制逻辑时;其次,RST[7]提供多字节数据或终止单字节的传送手段。所有的数据在RST为高电平时,传送被初始化,DS1302被允许进行操作。如果RST置为低电平,若传送则会终止此次数据传送,I/O引脚变为高阻态。在Vcc?2.5V之前,上电运行时,保持低电平对RST来说是必要的。当SCLK为低电平时,才能使RST为高电平状态。I/O为串行数据双向端(输入输出),后面则会有详细说明。时钟输入端为SCLK。 下图为DS1302的引脚功能图 Vcc 2Vcc 11 8 SCLK 2 7 X1 3 6 X2 I/O 4 5 RST GND 图3.2 DS1302的引脚图 第 6 页 共 51 页 陕西理工学院毕业设计 3.2.2 DS1302的控制字节 DS1302 的控制字节的最高有效位(位7)必须是逻辑1,如果它为0,则不能把数据写入DS1302中,位6如果为0,则表示存取日历时钟数据,为1表示存取RAM数据;位5至位1指示操作单元的地址;最低有效位(位0)如为0表示要进行写操作,为1表示进行读操作,控制字节总是从最低位开始输出。 3.2.3 数据输入输出(I/O) 在控制指令字输入后的下一个SCLK时钟的上升沿时,数据被写入DS1302,数据输入从低位即位0开始。同样,在紧跟8位的控制指令字后的下一个SCLK脉冲的下降沿读出DS1302的数据,读出数据时从低位0位到高位7。 3.2.4 DS1302的寄存器 DS1302有12个寄存器,其中有7个寄存器与日历、时钟相关,存放的数据位为BCD码形式,其日历、时间寄存器及其控制字见表1。 此外,DS1302 还有年份寄存器、控制寄存器、充电寄存器、时钟突发寄存器及与RAM相关的[8]寄存器等。时钟突发寄存器可一次性顺序读写除充电寄存器外的所有寄存器内容。 DS1302与RAM相关的寄存器分为两类:一类是单个RAM单元,共31个,每个单元组态为一个8位的字节,其命令控制字为C0H,FDH,其中奇数为读操作,偶数为写操作;另一类为突发方式下的RAM寄存器,此方式下可一次性读写所有的RAM的31个字节,命令控制字为FEH(写)、FFH(读)。 3.3 液晶显示屏LCD1602 本系统中使用的显示器是液晶显示器 LCD1602,它由一定数量的彩色或黑白像素组成,是平面超薄的显示设备。 3.3.1 LCD1602特点说明 液晶显示模块由于具有低功耗、寿命长、体积小、显示内容丰富、价格低、接口控制方便等优点,因此在各类电子产品中被极广泛地推广和应用。字符型液晶显示模块是一类专门用于显示字母、[9][10]数字、符号等点阵式液晶显示模块。本系统设计采用字符型液屏显示模块LCD1602 作为显示器件,这样不仅简化了系统的硬件设计,而且极大地提高了系统的可靠性。字符型液晶显示模块LCD1602是单片机应用设计中最常用的信息显示器件。LCD1602 可以显示两行,每行16 个字符,[11]采用,5V 电源供电,外围电路配置简单,价格便宜,具有很高的性价比。 3.3.2 LCD1602功能介绍 LCD1602各引脚功能如表3.2所示。 表3.2 LCD1602管脚功能表 编号 符号 引脚说明 编号 符号 引脚说明 1 VSS 电源地 9 D2 Data I/O 2 VDD 电源正极 10 D3 Data I/O 3 VL 液晶显示偏压信号 11 D4 Data I/O 4 RS 数据/命令选择端(H/L) 12 D5 Data I/O 5 R/W 读/写选择端(H/L) 13 D6 Data I/O 6 E 使能信号 14 D7 Data I/O 7 D0 Data I/O 15 BLA 背光源正极 8 D1 Data I/O 16 BLK 背光源负极 第 7 页 共 51 页 陕西理工学院毕业设计 (1)基本操作时序: LCD1602 读写操作时序总体上来说是比较简单的,掌握其有两种方法:一种是直接看时序图,另外一种方法是直接记忆和总结读写时电平高低和变化。很显然第二种更简单、直接,下面就列出[12]典型读写的时序要求,以方便编写程序。 读状态--输入:RS=L,R/W=H,E=H 输出:D0-D7=状态字 写指令--输入:RS=L,R/W=L,D0-D7=指令码,E=高脉冲 输出:无 读数据--输入:RS=H,R/W=H,E=H 输出:D0-D7=数据 写数据--输入:RS=H,R/W=L,D0-D7=数据,E=高脉冲 输出:无 (2)状态字说明: 表3.3 状态字表 STA0 STA1 STA2 STA3 STA4 STA5 STA6 STA7 D0 D1 D2 D3 D4 D5 D6 D7 表3.4 状态字读写使能表 STA0-6 当前数据地址指针的数值 STA7 读写操作使能 1:禁止 0:允许 对控制器每次进行读写操作之前,都必须进行读写检测,确保STA7为0 [12](3)指令说明: 表3.5 显示模式设置表 指令码 功能 0 0 1 1 1 0 0 0 设置16*2显示,5*7点阵,8位数据接口 表3.6 显示开/关及背光灯设置表 指令码 功能 0 0 0 0 1 D C B D=1开显示; D=0关显示 C=1显示光标; C=0不显示光标 B=1光标闪烁; B=0光标不显示 0 0 0 0 0 1 N S N=1当读或写一个字符后地址指针加一,且 光标加一 N=0当读或写一个字符后地址指针减一,且 光标减一 S=1当写一个字符,整屏显示左移(N=1)或 右移(N=0),以得到光标不移动而屏幕移动的效 果 S=0当写一个字符,整屏显示不移动 (4)数据控制 控制器内部有一个数据地址指针,它们可以被用户用于访问内部的、全部的80字节RAM 。 (5)数据指针设置 表3.7 数据指针设置表 指令码 功能 80H+地址码(0-27H,40-67H) 设置数据地址指针 第 8 页 共 51 页 陕西理工学院毕业设计 (6)其他设置 表3.8 其他设置指令表 指令码 功能 01H 显示清屏:1数据指针清零 2所有显示清零 02H 显示回车:数据指针清零 3.3.3 LCD1602初始化过程 (1) 延时15ms (2) 写指令38H(不检测忙信号) (3) 延时5ms (4) 写指令38H(不检测忙信号) (5) 写指令5ms (6) 写指令38H(不检测忙信号) (7) 之后每次写指令、读/写数据操作之前均需检测忙信号 (8) 写指令38H:显示模式设置 (9) 写指令08H:显示关闭 (10) 写指令01H:显示清屏幕 (11) 写指令06H:显示光标移动设置 [13] (12) 写指令0CH:显示及光标设置 3.4 无线NRF24L01芯片 NRF24L01是一款Nordic公司推出的新型单片射频收发器件,工作于2.4GHz,2.5GHz ISM 频段。内置频率合成器、功率放大器、晶体振荡器、调制器等功能模块,并融合了增强型ShockBurst 技[14]术,其中输出功率和通信频道可通过程序进行配置。 NRF24L01功耗低,在以-6 dBm的功率发射时, 工作电流只有9mA;接收时,工作电流只有12.3mA,多种低功率工作模式(掉电模式和空闲模 式)使节能设计更方便。 RF24L01主要特性如下:GFSK调制;硬件集成OSI链路层;具有自动应答和自动再发射功能;片内自动生成报头和 CRC 校验码;数据传输率为lMb/s或2Mb/s;SPI速率为0Mb/s,10Mb/s;125[15]个频道;与其他 NRF24系列射频器件相兼容;供电电压为1.9V,3.6V。 3.5 参数存储AT24C02芯片 美国ATMEL公司开发的AT24C02是低功耗CMOS串行EEPROM,它是具有工作电压宽[22](2.5V-5.5V)、内含256x8位存储空间、写入速度快(小于1Oms)等特点、擦写次数大于10000次。 AT24C02是带有片内地址寄存器的存储芯片。每读出或写入一个数据字节后,在这个地址寄存器上自动加一,用于对下一个存储单元的读写的实现。均以单一操作方式读取所有字节。为了降低写入的总时间,在一次操作中,可写入多达8个字节的数据。 第 9 页 共 51 页 陕西理工学院毕业设计 4.系统的硬件架构 本设计包括USB电源模块、单片机最小系统、无线收发模块、时间显示模块、时钟模块和按键模块。另外还有电路总开关、无线信号感应电路和继电器输出电路的设计,因为电路总开关与USB供电接口较近,且比较简单,所以归于USB电源模块中,后文不再详细介绍。同理,无线信号感应电路归于单片机模块。 4.1 USB电源模块 由于系统中使用单片机等精密芯片,为了保证电路的正常稳定运行以及电路的简化,特为电路中引入了USB接口供电,购买市面上常见的220V交流转直流5V接头,其中USB接口电路如下图。 图4.1 USB接口电路图 电源总开关选用按键自锁直键开关,连接其5,6脚。则未按下时,4,6脚接通,断路电源未接通;而按下时,5,6脚接通,电源接通。 4.2 单片机最小系统 本设计的单片机最小系统主要包括STC89C52芯片,晶振电路和复位电路。 4.2.1晶振电路 最小系统晶振电路如图4.2所示。 图4.2 晶振电路图 晶振电路内部有一个高增益反相放大器,它是用于构成振荡器的部分,引脚XTAL1和XTAL0分别是此放大器的输出端和输入端。时钟可以由内部方式产生,也可由外部方式产生。内部方式的时钟电路如图4.2所示,外接定时元件在XTAL0和XTAL1引脚上,自激振荡就会在内部振荡器上 第 10 页 共 51 页 陕西理工学院毕业设计 产生。定时元件通常采用并联谐振回路,它一般由石英晶体和电容组成的。晶体振荡频率的范围很广,可以在1.2,12MHz之间选择,电容值则在5,30pF之间可以选择,控制电容值的大小,就可[23]以对频率起微调的作用。 单片机晶振之中的两个电容的作用:这两个电容,其实是晶振的负载电容,它们分别接在对地的电容和晶振的两个脚上,一般在几十皮法。它会影响到晶振的输出幅度和谐振频率。晶振的负载电容=[(Cd*Cg)/(Cd+Cg)]+Cic+?C,式中Cg,Cd为分别接在对地的电容和晶振的两个脚上,?C(PCB上电容)+Cic(集成电路内部电容),经验值为3到5pF。 4.2.2复位电路 最小系统复位电路如图4.3所示。 图4.3 复位电路图 单片机总要涉及到复位电路的设计。而单片机复位电路设计的好坏,会直接影响到整个系统工作的可靠性。许多用户在实验室调试成功后,并在设计完单片机系统,而在现场时却出现了“程序24]走飞”、“死机”等现象,这主要是单片机的复位电路设计不完善造成的。复位电路的基本功能是:系统上电时提供复位信号,直至系统电源稳定后,撤销复位信号。为可靠起见,电源稳定后还要经过一定的延时才撤销复位信号,以防电源开关或电源插头分-合过程中引起的抖动而影响复位。单片机复位电路参数的选定须在振荡稳定后保证复位高电平持续时间大于2个机器周期。单片机复位电路主要有四种类型:微分型复位电路;积分型复位电路;比较器型复位电路;看门狗型复位电[25]路。 因本设计需要达到手动控制的目的,所以当分机电源已开时,其中复位键按下后,单片机重置,分机接收到信号,控制继电器关闭电源,就可实现手动控制电源开关。 第 11 页 共 51 页 陕西理工学院毕业设计 4.2.3最小系统整体图 最小系统整体电路如图4.4所示。 图4.4 最小系统电路图 4.2.4 无线信号感应电路 该功能主要由分机单片机编程完成,发光二极管负极连于单片机STC89C52的P0.7管脚,硬件电路如下图所示。 图4.5 无线信号感应电路 4.3 无线收发模块 本设计中无线接收与发射模块都采用NRF24L01芯片,但与单片机的连接管脚不相同,设计采用8线插槽实现单片机STC89C52与NRF24L01模块的连接,从单片机控制的角度来看,我们只需[26]关注NRF24L01的六个控制和数据信号,分别为CSN、SCK、MISO、MOSI、IRQ、CE。 NRF24L01芯片与STC89C52芯片连接电路图如下图4.6和图4.7所示。 图4.6主机NRF24L01芯片与STC89C52芯片连接电路图 第 12 页 共 51 页 陕西理工学院毕业设计 图4.7从机NRF24L01芯片与STC89C52芯片连接电路图 4.4 时钟模块 本设计中的DS1302芯片的SCLK、DSIO和RST引脚与STC89C52芯片相连接。X1和X2是振荡源,外接32.768kHz晶振,为主控芯片提供外部时钟频率。其中Vcc1为后备电源,VCC2为主电源。在主电源关闭的情况下,也能保持时钟的连续运行。DS1302由Vcc1或Vcc2两者中的较大者供电。 时钟模块电路如图4.8所示。 图4.8 时钟模块电路图 4.5 液晶显示模块 液晶LCD1602的D4-D7引脚与STC89C52芯片的P2口相接,而控制引脚RS,R/W,CS则分别接P00,P01,P02。引脚3接一个10K的滑动变阻器来调整对比度,从而达到合适的背光灯对比度。 液晶显示模块电路如图4.9所示。 图4.9 液晶显示模块 第 13 页 共 51 页 陕西理工学院毕业设计 4.6 按键模块 本设计中,主机设置有七个按键,其中复位键属于复位模块,就不再赘述。其余六个按键key1-key6接到单片机STC89C52的P32-P37起到调节时间日期等功能。六个键分别是:切换键K1、开启电源时间显示键K2、关闭时间显示键K3、上调键K4、下调键K5和确认键K6。 按键模块电路如下图4.10所示。 图4.10 按键模块 4.7参数存储模块 图4.11 AT24C02芯片与STC89C52芯片连接图 如图4.11所示,AT24C02的1、2、3脚是三条地址线,用于确定芯片的硬件地址。在系统主板上它们都接地,第8脚和第4脚分别为正、负电源。第5脚SDA为串行数据输入/输出,数据通过这2条双向IC总线串行传送,在系统主板上和单片机的P27连接。第6脚SCL为串行时钟输入线,在系统主板上和单片机的P26连接。SDA和SCL都需要和正电源间各接一个4K7的电阻上拉。第7脚需要接P25。 4.8 继电器输出电路设计 现代自动控制设备中,都存在互相连接的问题,即一个电子电路与电气电路的。一方面要能够控制电气电路的执行元件(电动机,电磁铁,电灯等),另一方面又要为电子线路的电气电路提供良[27]好的电隔离,以保护人身的安全和电子电路。电子继电器便能完成这一桥梁作用。 系统中使用5VDC输入220VAC输出型固态继电器。继电器线圈由PNP型三极8550驱动,如图4.12所示,在继电器的长开触点上由输出端子JP2的1, 2脚连接,一旦达到指定的时间,系统会自动关闭或开启继电器。若加一个二极管到继电器的线圈两头,可吸收继电器线圈断电时产生的反电势.防止干扰。继电器输出电路如图4.12所示。 图4.12继电器输出电路图 第 14 页 共 51 页 陕西理工学院毕业设计 5.系统的软件设计 系统硬件电路设计完成之后,就要进行软件的设计和调试。如果没有软件来控制硬件电路和外围设备,系统仍然是不完善的。在程序方面,采用模块化设计的方法,这样既减小了编程难度、使程序易于理解,又能便于添加各项功能。运用这种方法,关键在于各模块的兼容和配合,若各模块不匹配,会出现意想不到的错误。 5.1开发语言和开发环境 51单片机的编程语言常用的有二种,一种是汇编语言,一种是C语言. 在高级语言中,C语言还是比较接近硬件的语言,而且比起汇编语言来说,C语言比汇编语言更符合人们的思维习惯,用C语言进行系统开发者可以更专心地考虑算法而不是考虑一些细节问题。使用像C语言进行嵌入式系统开发时,程序员不必十分熟悉处理器的运算过程,这就意味着对新的处理器也能够很快上手,并不必知道处理器的具体内部结构。C语言同其他编程语言相比,具有以下优点: (1)编程调试方便。当前几乎所有的嵌入式系统都有相应的C语言级别的仿真调试系统,调试十分方便。 (2)生成代码编译效率高。当前较好的C语言编译系统编译出来的代码效率比直接使用汇编低20%左右,如果能优化编译甚至可以更低。 (3)模块化开发性好。 (4)可移植性好。 [28](5)项目的维护管理容易。 由于本设计是51单片机控制系统,利用C语言开发较之汇编语言有更好的效果,所以本系统的程序采用C语言编写。 而C语言开发在Windows视窗系统下有许多的的交叉编译环境,如Visual C++6.0、VS2003和Keil μVision4 等软件。 美国Keil Software公司出品的51系列单片机C语言Keil软件开发系统,与汇编相比,C语言在结构性、可读性、功能上、可维护性上有明显的优势,因而易用易学。 Keil软件提供功能强大的集成开发调试工具和丰富的库函数,界面是全Windows。另外重要的一点,Keil有非常之高的生成目标代码效率,由多数语句生成的十分紧凑的汇编代码,让人容易理[27]解。在开发大型软件的时候,更能体现高级语言的优势。 综合以上C语言的优点,本系统采用C语言在Keil编程环境下编程、调试,待调试完程序后,设置Keil单片机模拟调试软件使其编译生成可下载到实验板里的“.hex”文件,用STC_ISP下载程序时选择需要下载的“.hex”文件下载到系统单片机里面即可。 5.2系统软件的总体说明 无线电源开关控制器的功能是在程序控制下实现的。该系统的软件设计方法与硬件设计相对应,按整体功能分成多个不同的程序模块,分别进行设计、编程和调试,最后通过主程序将各程序模块连接起来。本系统的软件部分主要进行时间显示程序、日期显示程序、时间调整程序、定时开关时间调整程序和延时程序的设计,按键的输入扫描等。 程序开始运行后要进行初始化,包括设置定时器、LCD1602、DS1302、 NRF24L01、AT24C02及端口的初始化。发送端AT89S52完成初始化后,日历信息通过LCD1602显示出来,当实时时间与设定的开启关闭时间相同后,LCD1602上显示的时间仍然照常走动,时钟芯片向单片机发出中断请求,主机把NRF24L01配置成PTX工作模式。 启动NRF24L01发送数据,若从按键模块接收到数据,则将相应标志位置1,并将对应编号显示于 LCD 显示屏。若发送成功,则产生TX_DS中断。若重发超限,则产生MAX_RT中断。若发[28]送目标成功,则发送继续,否则对发送数据进行出错处理。 接收端AT89S52完成初始化后(把NRF24L01配置成PRX工作模式 。当正确接收数据时, 第 15 页 共 51 页 陕西理工学院毕业设计 NRF24L01产生接收中断标志 ,AT89S52从NRF24L01读取数据并校验数据标志位,如果对应标志位为1,通过改变电平,使继电器接通,以控制电源通断,则点亮LED指示灯。 此时,若按下主机复位键,可手动控制关闭分机电源。 5.3 软件设计总体流程图 软件设计总体流程图主要分为发送端流程图和接收端流程图,具体流程如图5.1(a),(b)所示。 (a)发送端流程图 (b)接收端流程图 图5.1 发送端流程图和接收端流程图 第 16 页 共 51 页 陕西理工学院毕业设计 5.4 按键输入模块 系统中有七个按键,即:复位键S1、切换键K1、开启电源时间显示键K2、关闭时间显示键K3、上调键K4、下调键K5和确认键K6。 (1)按下S1键,系统中如分机处于开启状态,则分机直接关闭电源。 (2)按下K1键,系统进入设置状态,再按下K1键,可在年、月、日、时、分、秒、星期上停留,此时再按下上调键K4键,即可进行加一操作,按下下调键K5即可进行减一的操作,设置完所有项目后,再按确认键K6即可。 (3)按下K2键或K3键会进入到开启或关闭时间显示界面,再按K1键可设置时间,设置完后,再按确认键K6即可。 5.5 液晶显示模块 液晶显示驱动程序。LCD1602 的程序主要是对内部控制器进行操作,如液晶初始化,读,写,判忙,制定位置等,这些操作驱动程序有子函数构成。 5.6 时钟处理程序 DS1302 数据处理要始终对内部的数据进行处理获得液晶显示需要的字符。主要包括DS1302的初始化,读一个字节,写一个字节,读写,数据处理等函数组成。对DS1302读写数据命令、DS1302RAM 读写命令和寄存器标志 内容的了解,实现计时,调时程序很容易。在程序中尽量使用位移、位或、位与来实现乘除法,这样可以节约单片机的处理时间。最后将时分秒年月日分解为字符送给液晶显[16]示。部分流程图如图5.3所示。 开始 DS1302初始化 设置DS1302 读年月日星期时分秒 将读取的数据处理后送 液晶屏显示 返回 图 5.3 DS1302读写流程图 第 17 页 共 51 页 陕西理工学院毕业设计 5.7 参数存储模块 2工艺参数存储部分由AT24C02作为外围存储区。AT24C02内有2K的存储空间,具有IC接口,22可以与单片机之间通过软件模拟IC时序建立IC通信,实现读取和存储数据。它通过SDA(串行数据线)及SCL(串行时钟线)两根线在连到总线上的器件之间传送信息,并根据地址识别每个器件。这[28]2里只用到一片AT24C02芯片,所以不需要地址识别。编程之前要掌握IC器件的读写操作时序,写AT24C02部分程序流程图如上图5.4所示。 2 (1) IC总线起始和停止条件 22 AT24C02是基于IC总线的器件,在IC总线技术中,起始条件(S)和停止条件(P)一般是22由主器件产生的。起始条件表明一个IC总线传送的开始,停止条件则表明IC总线通信的结束。SCL为高电平时,SDA由高电平到低电平的跳变被定义为起始条件,而SDA有低电平到高电平的跳变[25]2未停止条件。IC总线在起始条件以后被认为处于忙状态,在停止条件以后,如果没有起始条件产生,这段时间总线可以被认为是处于空闲状态。 2 (2) IC总线的位传输 22 IC总线协议的技术规范中规定每次发到IC总线SDA上的数据必须是一个字节,但每次传输[27]可以发送的字节数量是不受到限制的。传输的数据字节按照由高位到低位的顺序发送,每发送一个字节后必须跟一个响应位.如果AT24C02在接收到下一个字节之前需要一定的时间对当前的数据进行处理,那么在AT24C02完成当前数据的接收后.将保持SCL为低电平,通知单片机进入等待状态,直到AT24C02准备好接收下一个字节数据,释放时钟线SCL,单片机才可以继续发送数据. 2 (3) IC总线上的数据响应 在响应脉冲期间,AT24C02将总线拉低,并使得SDA在这个时钟脉冲的高电平期间保持稳定的低电平。AT24C02响应信号结束后,SDA返回高电平,进入下一个传送周期。 开始 逐位写入数据 写程序入口 N 总线空闲, Y 释放总线 写命令字 写要存放数据的地址 结束 图5.4 写AT24C02程序流程图 第 18 页 共 51 页 陕西理工学院毕业设计 6.系统测试及数据分析 6.1距离测试 测试不同障碍物下,主机控制分机开关机有效距离,结果如下表6.1所示。 表6.1 距离测试 障碍物材料 无障碍物/m 有障碍物/m 书本桌子砖石等 9-10m 钢板等金属 10m-12m 6-8m 玻璃 9-10m 结论:障碍物影响信号的发射接收,而金属物影响相对更大。 6.2自动开关机模式测试 提前设定好开关机时间,测试实时时间,是否相符。(其中开机时间设定为10:00,关机时间设为13:00)自动模式测试结果如下表6.2所示。 表6.2 自动模式测试 显示时间 交换机状态(LED反馈) 10:00:02 灯亮 13:00:01 灯灭 6.3手动控制模式测试 手动设置开机时间,复位键代替关机键,测试实时时间是否相符。(其中开机时间设定为14:00,关机时间设为15:00)自动模式测试结果如下表6.3所示。 表6.3 手动模式测试 显示时间 交换机状态(LED反馈) 14:00:01 灯亮 15:00:01 灯灭 6.4多通路模式 用一个单片机主机控制几个分机,且控制对象在不同的地方,测试结果如下表6.4。 表6.4 多通路测试 机组 距离/m 显示时间 交换机状态(LED反馈) 1 10 16:00-17:00 灯亮/灯灭 2 4 16:00-17:00 灯亮/灯灭 结论:测试6.2、6.3、6.4显示LED灯正常反馈,说明电路功能正常。 第 19 页 共 51 页 陕西理工学院毕业设计 结论 在本次毕业设计课题的研究中,我大有收获。首先在选择毕业设计课题时,我本着巩固所学理论知识,加强实际动手能力,增加对现代科技特别是无线和通信方面的了解,圆满完成大学本科学业的想法,选了节能型交换机无线开关控制的设计这一实际而又有挑战性的课题。 应用单片机的定时中断功能,该设计可以进行定时控制,并通过NRF24L01将信号送给接收部分,在定时时间到达时,接收端控制继电器闭合,通过LED 灯可实现信号的反馈。如果对该系统加以开发利用,只要检测到用户请求,家电就能实现开关机,那家电智能化的时代就会更丰富。 经过四年学习的积累,在已经掌握相关专业方面知识及其它各方面知识的情况下,我认真且严肃的完成了我的毕业设计。这次毕业设计历时至少3个月,由一开始的确定课题,再到后来的资料查找、理论学习应用,再有就是近来的软件设计、硬件电路组建、结果分析和测试过程。这一切都使我的理论知识理解力和动手能力得到很大的加强。可以说是一次全面综合的电路知识检验。 在通信理论的学习和实际芯片的识别、电路的组建、分析以及后来的测试过程中,我不可避免地遇到各种问题,我在积极思考的前提下,请教了同学或指导老师,比较顺利的一一解决了问题,圆满完成了设计制作。 这次毕设对我的求实精神、面对困难的积极心态都有极大的考验,我也曾消沉止步不前,但在周围拉奥是的和同学的感染下,我从困境中挺了过来。我在这个过程中深刻的感受到了做毕业设计的意义所在,那就是坚持不放弃就会成功。 第 20 页 共 51 页 陕西理工学院毕业设计 致谢 本课题的研究和论文的完成是在李菊叶老师的耐心指导和热情帮助下完成的。老师严谨的治学态度、丰富的实践经验、兢兢业业的工作精神都使我受益匪浅。老师豁达的胸怀对我树立正确的人生观和价值观产生了积极的影响。在老师的指点和关注下,我的理论知识理解和动手经验都得到了很大的提高。在我人生道路上,老师无微不至的关注让我更加坚稳的走好每一步。跟随老师学习以来,我获得了一生中最宝贵的财富,就是丰富的知识和如何运用它的方法。在此谨向曾老师表示崇高的敬意和衷心的感谢! 感谢老师在研究工作中对我进行的悉心指导,使我的论文的撰写得以顺利进行。为我的学习提供了良好的条件,成功的完成了毕设的软硬件设计。 最后感谢我的父母,你们对我的无私关爱让我健康成长到了今天。我顺利的完成了大学的学业,即将成为一个就要步入社会的人,我会实现自我的价值,为自己、家庭,更为社会做出更大的贡献~ 第 21 页 共 51 页 陕西理工学院毕业设计 参考文献 [1] 黄智伟(单片无线数据通信 IC 原理与应用[M](北京:北京航空航天大学出版社,2004:12-34. [2] 王宜怀(单片机原理及其嵌入式应用教程[M](北京:北京希望电子出版社,2002;68-84. [3] 刘志平,赵国良(基于 nNRF24L01 的近距离无线数据传输[J](应用科技,2008(3). [4] 邵贝贝,龚光华(单片机认识与实践[M](北京:北京航空航天大学出版社,2006:54-66. [5] 谢自美(电子线路设计实验测试[M](武汉:华中理工大学出版社,1992. [6] 何立民(单片机应用系统设计[M](北京:北京航空航天大学出版社,1993:68-89. [7] 楼然笛(单片机开发[M](北京人民邮电出版社,1994:122-134. [8] 付家才(单片机控制工程实践技术[M](北京化学工业出版社,2004.3. [9] 李光才(单片机课程设计实例指导[M](北京:北京航空航天大学出版社,2004.3. [10] 朱定华(单片机原理及接口技术实验[M](北京:北方交通大学出版社,2002.11. [11] 刘湘涛,江世明(单片机原理与应用[M](北京:电子工业出版社,2006. [12] 张大波,吴迪,赫军等(嵌入式系统原理、设计及应用(北京:机械工业出版社,2005. [13] Wang L X and Mendel)M. Generating Fuzzy Rules form Numerical Datawith Applications. IEEE Trans. Syst,Man and Cybern, 1992,22(6):1414-1427 [14] Lee C C Fuzzy Logic in Control System:Fuzzy Logic Controller. IEEE Trans. Syst, Man and Cybern, 1990, 20(2) :404-435 [15] Michels K. A Model-Based Fuzzy Controller. Fuzzy Sets and System, 1997, 85(2):223-232. [16]STC.STC89C52RC.+_GUIDE-CHINESE.pd f. [17]中数休闲(AT24C02串行E2PROM的工作原理[EB/OL].;page=1,2007-1-19 [18] 刘蕴韬(FPGA应用实例--实现I2C总线主机控制器(电子世界,2014.6. [19] 94HC6800-6( 三亿文库([20] ictest8(I2C总线应用下的EEPROM测试[DB/OL] ,,2006.10.27 [21] 求是科技(单片机通信技术与工程实践(北京:人民邮电出版社,2005. [22] 求是科技(单片机典型棋块设计实例导航(北京:人民邮电出版社,2006. [23] 余永权,汪明恩,黄英编(单片机在控制系统中的应用(北京:电子工业出版社,2003. [24] 李刚,林凌,姜苇中数休闲51系列单片机系统设计与应用技巧(北京:北京航天航空大学出版社,2004. [25] ATNEL.AT24CO2A [26] 张义和(ProtelDXP电路设计大全(北京:中国铁道出版社,2005. [27] 程显(精通Protel DXP电路设计(北京:清华大学出版社,2004:37-84. [28] 韩洁琼,曾牌,余永权,李太(四层电路板的PCB设计(单片机与嵌入式系统应用,2006.8:15-14. 第 22 页 共 51 页 陕西理工学院毕业设计 附录A 英文文献及其翻译 外文文献: Saving Energy in LAN Switches: New Methods of Packet Coalescing for Energy Efficient Ethernet Mehrgan Mostowfi and Ken Christensen Department of Computer Science and Engineering University of South Florida Tampa, Florida {mostowfi, christen}@cse.usf.edu Abstract—Small or home office (SOHO) Ethernet LAN switches consume about 8 TWh per year in the U.S. alone. Despite normally low traffic load and numerous periods of idleness, these switches typically stay fully powered-on at all times. With the standardization of Energy Efficient Ethernet (EEE), Ethernet interfaces can be put into a Low Power Idle (LPI) mode during idle periods when there are no packets to transmit. This paper proposes and evaluates a new EEE policy of synchronous coalescing of packets in network hosts and edge routers. This policy provides extended idle periods for all ports of a LAN switch and thus enables energy savings deeper than in the Ethernet PHY only. We evaluate our method using an ns-2 simulation model of a LAN switch. We show that our method can reduce the overall energy use of a LAN switch by about 40%, while introducing limited and controlled effects on typical Internet traffic and TCP. Keywords-Ethernet switch; synchronized coalescing; Energy Efficient Ethernet; green Internet I. INTRODUCTION Networked electronic devices consumed almost 4% (150 TWh) of all the electricity in the U.S. in 2008, about 13% (20 TWh) of which was consumed by net- work equipment such as network switches and routers [22]. Ethernet, as the dominant wireline technology for LANs, constitutes a significant portion of the energy use of com- puter networks. The most recent advance in reducing the energy consumption of Ethernet is Energy Efficient Ethernet (EEE) which was standardized as IEEE Std 802.3az-2010 in September 2010 [12]. Products that use EEE are beginning to ship in mid to late 2011. EEE enables an Ethernet link that is idle to exit Active mode and enter a Low Power Idle (LPI) mode. The power used in LPI mode is significantly less than in Active mode since some components of the physical layer (PHY) can be powered off. The IEEE 802.3az standard does not describe a policy for entering and exiting LPI. A simple policy would be to enter Active mode when packets are queued in the transmit queue in the interface and enter LPI mode when the queue is empty. Such a policy has been found to be ineffi- cient (that is, wasteful of energy) due to excessive transitions between the Active and LPI modes [25]. Each transition incurs a delay and energy use. A policy to batch, or coalesce,packets was proposed and explored by Christensen et al. in 2010 [6]. Coalescing improves the energy efficiency of Ethernet interfaces in hosts as well as in Ethernet switches. The overall energy consumption of a switch is reduced by EEE as a result of the reduction in energy consumption of individual interfaces of the switch. However, we believe that energy savings by EEE can go beyond the savings in individual interfaces if all the switch ports enter LPI mode at the same time, or synchronously. Synchronized LPI periods provide the opportunity for additional components of the switch to power down since it would be certain that there are no packets in any port buffer, or within the switch fabric, that need to be forwarded. In synchronized coalescing the control of when to coalesce and for how long is moved to the switch (from the host interfaces) and the coalescing periods are synchronized on all the ports of the switch. The target switches for our synchronized coalescing method are the ones mostly used in households and small offices. This type of switch, which are referred to as SOHO (small or home office) switches hereafter, typically includes 4 to 10 ports and cost less than $100. Two factors motivated us to propose synchronized 第 23 页 共 51 页 陕西理工学院毕业设计 coalescing. The first is the typi- cal low utilization of switches in general [9]. The second is that although SOHO Ethernet switches consume only a small amount of energy individually, the number of them deployed in the country is so high that it makes their consumption significant and even a small savings per switch would add- up to a significant overall savings. Using a Kill-A-Watt power meter, the power use of a Linksys EG005W Gigabit Ethernet switch with 4 connected active links was measured as 10 W. We estimate that the current consumption of SOHO Ethernet switches is approximately 7.9 TWh/year based on the number of housing units in the U.S. [26], assuming that about 70% have an Ethernet switch installed, and that each switch is powered on all the time. At the current average electricity cost ($0.10/kWh) this is a total of about $790 million per year in electricity use. While current Ethernet links and switches are mostly 100 Mb/s and 1 Gb/s, we envision that they are likely to evolve to 10 Gb/s in the near future for several reasons including, 1) ever-decreasing prices [20], 2) fast adoption by vendors [18], and 3) increasing bandwidth requirements of multimedia applications within households (for example audio/video transfer between storage device and player, and LAN-based multi-player video games). The contributions of this paper are the proposal and explanation of synchronized coalescing and evaluation of its performance trade-offs and effects on typical Internet traffic and TCP through simulation. The remainder of this paper is organized as follows. Section II reviews EEE and previous work that has been done in policies to control EEE. Section III presents a micro-level study of the power use of SOHO Ethernet switches and the opportunity of powering down individual components. Section IV explains the new synchronized coalescing method. Section V is a simulation evaluation of the method. Section VI describes related work. Section VII summarizes, describes future work, and estimates the potential energy savings that could be gained by large-scale deployment of the presented methods. II. OVERVIEW OF ENERGY EFFICIENT ETHERNET (EEE) EEE brings the energy consumption of Ethernet links closer to the ideal consumption, which is directly propor- tional to the utilization of the link. Estimates show that using EEE in all current 1 Gb/s edge links in both residential and commercial buildings and network equipment links within residences could save about $180 million/year in the U.S. alone [6]. Two modes are defined in EEE; Active mode and Low Power Idle (LPI) mode. In Active mode the link is powered-on to transmit packets. When there are no more packets to transmit, the link can enter LPI mode in which the physical layer is powered off and elements in the receiver are stopped. The arrival of a packet to the link can result in the link to wake up in a few microseconds to resume packet transmission (Figure 1). In this figure, Ts is the time needed to enter LPI mode and Tw is the time needed to return to Active mode. During the Tw, Ts and Tr periods the link consumes full power, while during Tq only almost 10% of the full power consumption of the link is needed [25]. The refresh cycle of duration Tr is a periodic link activity to maintain the alignment of receiver elements to channel conditions. It can be assumed that the link uses the same power as in Active mode during transitions [25]. The minimum Tw and Ts for 10GBASE-T links are 4.48 and 2.88 μs respectively [12]. The transition times are relatively high compared to the transmission time of 1.2 μs for a 1500- byte packet at 10 Gb/s. A. Improving the efficiency of EEE The transition times of EEE are large compared to the transmission time of a packet. For instance, if the link wakes up to transmit a single 1500 byte packet, it would spend 1.2 μs transmitting the packet and 7.38 μs for transitioning from LPI mode to Active and back. This means that only about 14% of time is dedicated to transmitting the packet and the rest to the transitions. This inefficiency of EEE was first explored by Reviriego et al. [25] in 2009. EEE can be most efficient when packets arrive back to back in bursts. As a result, only one sleep and one wakeup transition is required per burst which makes the percentage of time the interface spends in active mode close to the link utilization. This best case often 第 24 页 共 51 页 陕西理工学院毕业设计 occurs in the form of file downloads using TCP where large blocks of data are burst onto a link from a server to a client at a high rate. Conversely, the worst case happens when packets arrive with a fixed inter-arrival time and a spacing greater than the wake and sleep transition times. As a result, one wake and one sleep transition would be required for transmission of each packet resulting in inefficient operation. A close-to- worst case traffic scenario occurs when TCP ACKs are being returned from a client to a server. TCP ACKs are typically small packets and are spaced-out evenly (Figure 2). The inefficiency of EEE can be reduced by coalescing the outgoing packets into bursts thus decreasing the number of necessary transitions to one per burst. Packet coalescing for EEE is demonstrated and studied in [6]. EEE with packet coalescing is depicted in Figure 3. As shown in this figure, when all the packets in the transmit queue (or buffer) are transmitted and the buffer becomes empty, the link is put to LPI mode after a sleep transition which takes Ts time. The packets which arrive thereafter are not transmitted immediately but are buffered into a coalescing buffer. When a maximum time passes from the arrival of the first packet to the coalescing buffer, or the number of buffered packets reaches a pre-defined maximum, the link exits the LPI mode, which takes Tw time. All the coalesced packets are transmitted in a single burst. Refresh periods are omitted in Figure 3, since Tq >> Tr. III. SWITCH ENERGY USE AND TRANSITION TIMES To determine the possible energy savings from synchro- nization of LPI periods between all ports in a switch, it is necessary to answer the following three questions: 1) Which components of the switch can be powered down? 2) How much reduction in total switch power use can be achieved by powering down these components? 3) What are the required times to transition these compo- nents from fully-powered to powered-down mode and back? The main component of a typical SOHO Ethernet switch is a single CMOS switch chip. D-Link DGS-1008G, Linksys EG008W, Netgear GS608, and Trendnet TEG S8 are com- mon examples of such switches (all are Gigabit Ethernet switches). The ,rst uses Vitesse VSC7388 SparX-G5 [27], and the rest use Broadcom BCM5398 chips [5], both of which are switch-on-a-chip ICs that include the switching fabric, Ethernet port blocks, interfaces to external CPUs, memories, and the layer 2 packet header processor. The chip is connected to the copper interfaces and optionally to external memories and CPUs. The switching fabric is a high performance bus, shared among all the port blocks and the processor. Each port block consists of a copper PHY, a MAC and ingress and egress packet queues. The packet forwarding tables are maintained in the processor’s memory and registers. Packets enter through PHY interfaces, are passed to the MAC, are put in the port block’s egress queue, and are then put on the bus. The header of the packet is analyzed by the packet processor and either the forwarding port is determined, or it is ,ltered. The forwarding tables are modi,ed accordingly at this point, if needed. The packet is then put in the ingress queue of the forwarding port. Then it goes through the MAC and the PHY to the outgoing interface. We believe that a synchronized idle period could allow the switch chip to sleep while maintaining internal state. It is important, however, to empty all the ingress and egress queues prior to power down in order not to lose any packets. This answers question 1. To answer question 2, the power use of a 10 Gb/s SOHO Ethernet switch must ,rst be determined. Since such switches are yet to be manufactured and marketed for SOHO use, we estimate their power use as follows. We measured the average power use of a Linksys EG005W Gigabit switch with 4 active links as 10 W. We envision 10 Gb/s switches becoming commonplace around 2016, roughly 10 years after the standardization of 10GBASE-T, which is the same time span from the standardization of Gigabit Ethernet in 1999 to 1 Gb/s becoming status quo in 2009. Using 100 W consump- tion as the base (linear relation with capacity increase) and 20% yearly improvement in router power ef,ciency [2], the power use of future 第 25 页 共 51 页 陕西理工学院毕业设计 status quo switches over 10 years would be roughly 10 W (that is, the same as today). The CPU and memories of the linecards of a high-end enterprise router consume more than 50% of the linecards power [7]. We assumed that the breakdown of the power use of a 10 Gb/s SOHO switch will roughly correspond to the breakdown of a single line card of an enterprise router with the CPU and memories embedded in the switch chip. Therefore we assumed that by powering down the chip the overall power use decreases to 50% overall. To answer question 3, we use the transition times between C0 and C6 states of an Intel i5 multi-core processor (2 ms) as a conservative upper bound of the transition time for both the chip and possible external CPUs [4]. The synchronized LPI periods should be at least twice this time to allow the chip to transition to the low-power state and back to the full-power state. IV. THE SYNCHRONIZED COALESCING METHOD In synchronized coalescing, all the links connected to a LAN switch are stopped from sending any traf,c at the same time for a ,xed period of time. The network interfaces at both ends then enter LPI mode automatically, and the previously described components of the LAN switch can be turned off or put into a sleep mode. Synchronized coalescing is speci,cally intended for SOHO Ethernet switches since these are the most lightly utilized switches in the network with many idle periods. Therefore, there is a good opportu- nity of saving energy in these switches while minimizing any possible adverse effect on the performance of the network. Synchronized coalescing builds on the Pause Power Cycle (PPC) idea that was proposed and prototyped prior to the standardization of EEE in 2008 [3]. Figure 4 shows a high-level system view of how synchro- nized coalescing works. This is similar to the con,guration used in [3]. Synchronized coalescing is implemented in the LAN switch and works as follows: a noti,cation message (referred to as Pause Noti,cation hereafter) indicating that the interface connected to the port must not send any traf,c for an arbitrary interval is sent by the switch on all the ports. The switch then enters a low-power mode in which the components mentioned earlier are powered off or put into a sleep state. When the interval elapses, the switch powers up to a fully operational state and resumes servicing packets (ON state). The time that the switch spends in OFF and ON states are called Toff and Ton respectively. Based on Toff and Ton, a parameter called Duty Cycle (D) is de,ned as Ton/(Ton + Toff). By ,xing Toff and D, Ton can be determined as (D?Toff)/(1?D). One of the mechanisms that can be used to notify the NIC to stop sending any traf,c for a period of time is the ,ow control mechanism known as PAUSE frames de,ned in Ethernet standard. However, the traf,c stopping part of synchronized coalescing could be implemented using other noti,cation mechanisms as well. The implementation of synchronized coalescing in real switches requires some sort of Pause Noti, cation to be supported by MAC or PHY layers. PAUSE frames notify the NIC to temporarily stop the ,ow of traf,c (except for MAC control frames) for a certain period of time [14]. PAUSE frames are intended to allow an end of a connection to recover from a congestion state by temporarily stopping the other end from transmitting more packets. By setting MAC Control Parameters ,eld to Toff value, PAUSE frames can be used to make sure that no traf,c will be received and powering off will not cause packet loss. A. Simple synchronized coalescing The simplest version of synchronized coalescing is when the switch stays in ON state for a ,xed period of time, enters the OFF state, stays there for a ,xed period of time and the process repeats. Simple synchronized coalescing is described by a Finite State Machine (FSM) in Figure 5. The switch is fully operational in the ON state, while the links connected to the switch are paused and the switch is powered down (or sleeping) in the OFF state. Two timers are de,ned; TON and TOFF which maintain the time spent in ON and OFF states. The initial values of the timers are Ton and Toff, respectively. B. Adaptive coalescing The use of simple synchronized coalescing results in large increases in per packet delay especially when 第 26 页 共 51 页 陕西理工学院毕业设计 the aggregate load on the link is high or when sudden bursts of packets ,ow to the switch. This effect will be demonstrated and explained further in Section V. To reduce this effect, a modi,cation to simple synchronized coalescing is made which regulates the transition to the OFF state based on the number of packets received while in the previous ON state. Simple synchronized coalescing with this modi,cation is called adaptive coalescing hereafter. Adaptive coalescing is described in the FSM in Figure 6. This FSM has the same states as the FSM in Figure 5. A new array and a new variable are de,ned as following: • pktCount: An array of the size equal to the number of links connected to the switch. Each element of pktCount stores the number of packets received from the corresponding link. Index i is for the pktCount and ranges from 1 to the number of links. • thresh: The threshold which is compared to the max- imum of all pktCountis to determine if transition to OFF state should be made. Upon start or reset, the switch enters ON state, TON is set to its initial value Ton and starts to count down. Also, all elements of pktCount are initialized to 0. When TON expires, two cases can happen: 1) the maximum over all elements of pktCount is greater than or equal to thresh (this to handle uniformly distributed load among all ports, as well as heavy traf,c or sudden burst on a single port), in which Pause Noti,cations are sent on all the links, TOFF is reset, starts to count down and the switch enters OFF state, or 2) otherwise; in which case TON is reset to its initial value and starts to count down, all elements of pktCount are set to 0 and the switch remains in ON state for another ON period. Upon expiration of TOFF, TON is reset to its initial value and starts to count down, all elements of pktCount are set to 0, the switch returns to ON state and the entire procedure repeats. V. EVALUATION BY SIMULATION We evaluated the energy savings and performance trade- offs of our methods using an ns-2 [21] simulation model. To model synchronized coalescing in ns-2 we added two timers to the wired PHY module of LAN networks to stop and resume passing packets to the lower layer for ,xed periods of time. We synchronized ON and OFF periods among all the links in a LAN by using static variables shared among all the PHYs. The experimental factors of the system con,guration were bandwidth and the RTT of the server-edge router, switch- edge router link, and switch-client links. The factor of the traf,c ,ows was data ,ow type - arbitrary packet distribution or FTP. The factors of synchronized and adaptive coalescing were Toff, D, and thresh. The response variables were the switch ON time, download time (for ,le transfer), and average per packet delay (for arbitrary packet distribution ,ows). From the switch ON time, energy savings could be calculated. A. Design of experiments We modeled the network con,guration shown in Figure 4 in ns-2 for all of our simulation experiments. The server and the edge router were connected by a simulated link with 100 μs RTT. Wherever the transport protocol was TCP, a maximum congestion window size of 60 packets was used which corresponds to the default maximum TCP window size in most Microsoft Windows distributions. The switch and the edge router were in the same LAN with 2 μs RTT. The clients and the switch are in another LAN with the same 2 μs RTT. This roughly corresponds to a LAN whose clients, switch and edge router are located in the same building. We seek to answer the following questions with an exper- imental evaluation of a simulation model of synchronized coalescing: 1) How does synchronized coalescing handle high traf,c loads and sudden packet bursts? 2) How do the parameters of adaptive coalescing affect switch ON time? 3) What are the performance tradeoffs of adaptive coa- lescing? 4) How does adaptive coalescing affect real applications such as ,le download? 第 27 页 共 51 页 陕西理工学院毕业设计 Three experiments were designed; they were 1) high load effect experiment, 2) threshold experiment, and 3) ,le down- load experiment. Each experiment was designed to answer the questions listed above. High load effect experiment. This experiment was de- signed to study the effects of high loads and sudden bursts of packets on the performance of synchronized coalescing (Question 1). Packets ,ow from Client 1 to the switch over UDP. Packet interarrival time was exponentially distributed. At large time scales network traf,c is likely self-similar [16], however a Poisson distribution remains a reasonable ,rst-order approximation in cases which the traf,c is highly aggregated and the traf,c sample is taken in sub-second (small) time spans [15]. The size of the packets was ,xed to 1500 bytes (maximum Ethernet MTU, compatible with bridged/switched 1 Gb/s systems). Simple synchronized coalescing was enabled on the switch with two duty cycles of 10% and 50%. Toff was ,xed to 100 ms. Since 100 ms is approximately the human response time, this is likely the upper bound of tolerable delay. A Toff of 100 ms limits the relative time and consequent energy waste of transitions to less than 2% of the sleep time. The offered load was varied by manipulating the mean interarrival time of the packets. The response variables of interest were the switch ON time and average per packet delay. Threshold experiment. This experiment was designed to study the effects of the threshold used in adaptive coalescing on packet delay and switch power use (Questions 2 and 3). A packet ,ow (with exponential interarrival times) over UDP from Server to Client 1 with a ,xed packet size of 1500 bytes and variable offered load was modeled as in the previous experiment. Toff was again ,xed to 100 ms. Adaptive coalescing was enabled on the switch with 10% duty cycle. Two thresholds of 1000 and 5000 packets were used. The former (low threshold) corresponds to almost 10% of the link capacity (equal to the duty cycle). The latter (high threshold) is almost half of the link capacity. The response variables of interest were the switch ON time and average per packet delay. File download experiment. This experiment was designed to study the effects of Toff and the adaptive coalescing threshold on ,le download over TCP (Question 4). A 125 Megabyte ,le (corresponding to the ,le size of a small video clip) was downloaded by Client 1 from the Server using FTP. Adaptive coalescing was enabled on the switch with a 10% duty cycle. Three adaptive coalescing thresholds of 100, 500 and 1000 packets were used to show the effects of various thresholds on the response variables. Toff was varied to cover the range from 0 to slightly more than the 100 ms. The response variables of interest were the ,le download time and the switch ON time. B. Experiment results and discussion The experiment results were as follows. For the high load effect experiment the average per packet delay as a function of offered load on the link is shown in Figure 7. It can be observed that when the load is more than the duty cycle, the average delay starts to rapidly increase due to instability of the buffer queue. Note that packets are delayed in the NICs connected to the switch, not inside the switch. This is due to halting of transmission from the NICs temporarily during Toff periods while the packets are still being generated. The same phenomenon happens if there is a sudden burst in the traf,c, even though the overall load is less than the duty cycle. The threshold for skipping OFF periods in adaptive coalescing is an effective way to overcome this shortcoming. The switch ON time is the same as the duty cycle regardless of load. The results for the threshold experiment in Figure 8 show the percentage of time the switch spends in ON state as a function of load. Using the high threshold, the ON time of the switch is less than 10% different than the load-proportional which is the ideal ON time for the switch. However, the ON time is more when the low threshold is used. Using the low threshold, when the load exceeds the duty cycle (10%) the ON time ascends quickly to 100% and stays at this level as the load increases. This sudden increase is because the number of arriving packets during ON periods exceeds the threshold. The “steps” seen in both traces are also because the number of arriving packets exceeds the threshold. At the points that the ON time increases to the next step, the number of packets arriving during some of the ON periods exceeds the threshold. After each increase to a given step, the ON time stays roughly the same until the next increase to 第 28 页 共 51 页 陕西理工学院毕业设计 a new step. This is because while the number of arriving packets increases, the increase is not so high to cause any more ON periods to have more arriving packets than the threshold. Therefore, the ON time does not change in these intermediate loads. Although adaptive coalescing brings the ON time close to load-proportional, it introduces a delay to some packets. The reason is that the switch is sometimes OFF and unable to service packets while packets keep arriving to the attached devices to the switch. These packets are queued and delayed. Figure 9 shows the average packet delay caused by adaptive coalescing as a function of offered load for the two thresholds. Steps are also seen in this ,gure as the load increases. Each step corresponds to an ON time step in Figure 8. The reason is the same as what described for ON time. The average per packet delay is less than half of the human response time (50 ms) which has minor negative effect for non-delay-sensitive applications [23]. The sudden drop in the delay at 10% load by using the low threshold happens when the number of packets arriving to ON periods exceeds the threshold constantly, which causes the switch to stay ON and service the packets immediately. If no coalescing were used, it would take about 1 s to download an entire 125-Megabyte ,le over the 1 Gb/s bandwidth (of the link between the edge router and the server through the Internet). Figure 10 shows the download time of the ,le for the ,le download experiment when using simple synchronized coalescing and adaptive coalescing with 10% duty cycle and three thresholds. Using simple synchronized coalescing with 10% duty cycle is as if the capacity of the switch is cut to 10%, which makes the capacity of the switch links equal to the bandwidth of the server through the Internet (1 Gb/s). This would suggest no increase in ,le download time. However, it is seen in Figure 10 that this is only the case when Toff is very small (less than 3 μs). As Toff increases, the download time increases exponentially until it becomes stable at about 10 s which is about one tenth of the capacity of the link between the edge router and the server. Instrumentation of our simulation showed that this counterintuitive effect is due to side effect with the TCP congestion control mechanism. If Toff is longer than the time needed to transmit a full congestion window, the transmission pauses from the server until the window frees up in the next ON period. This effect can be controlled by reducing Toff. As explained in Section III, however, Toff cannot be set to less than 4 ms due to transition times. Too small Toff times, although more than the minimum, drastically increase the power waste due to relatively high transition times.Adjusting the threshold instead, can be used to control this effect temporarily while not sacri,cing the bene,cial length of Toff. As seen in Figure 10, if the threshold is set to roughly the same number of packets that could be transmitted at full rate in a Ton, (for instance 100 packets for the duty cycle of 10%, Toff of 10 ms and Ton of 1.11 ms) the threshold is exceeded in case of a ,le download and makes the transfer time the same as it would be if no coalescing method were used. As a consequence, the switch would stay ON for the entire download time as depicted in Figure 11. Figure 11 shows the percentage of time the switch spends in ON state as a function of Toff for the duration of the complete download of the ,le over FTP. The same three thresholds as in Figure 10 are shown. As expected, the switch stays ON for 10% of the time when the threshold is larger than what transmitted in an OFF period. When the threshold is exceeded, the switch stays ON constantly. From the results of our experiments, it seems that adaptive coalescing can save a signi,cant amount of energy on a 10 Gb/s SOHO Ethernet switch with only small trade-off in reduced performance provided that the following conditions are met: • The Duty cycle (D) is set to a value which makes the switch spend most of the time in OFF state. • The control variable Toff is set to less than the human response time and reasonably more than the switch transition times. • The threshold (thresh) is set to a value which detects ,le transfers and bursts well. We proposed 10%, 100 ms, and 1000 packets for D, Toff, and thresh respectively, and showed that these values pro- vide about 80% sleep time for the switch while introducing a small reduction in performance (less than 50 ms of average per-packet delay and almost no reduction in the case of a sudden traf,c burst 第 29 页 共 51 页 陕西理工学院毕业设计 with the expense of less energy savings). VI. RELATED WORK The ,rst standard which included a coalescing method for the purpose of saving energy was in wireless networks in late 1990s. In 1999, the Power Saving Mechanism (PSM) for Distributed Coordination Function (DCF) in IEEE 802.11 wireless networks was standardized [13]. In PSM, time is divided into equal beacon intervals. Packets destined for a wireless station are coalesced in the preceding station until they are transmitted during the ,rst beacon interval. Proposed improvements to PSM modi,ed the coalescing criteria to improve its performance under speci,c conditions or for a special type of traf,c ([24] for instance). The most recent coalescing method for wireless mobile devices is Catnap [8]. Catnap introduces a proxy on the wireless router connecting the mobile device and the Inter- net. The proxy gathers incoming packets and bursts them to the wireless device on scheduled intervals letting the device sleep between the bursts. Research in reducing energy use of wired networks started in the early 2000s [11]. The ,rst proposed use of packet coalescing to reduce energy use of Ethernet switches was Dynamic Ethernet Link Shutdown (DELS) [10]. DELS makes a decision to sleep a LAN port based on the statistics of the packets already buffered in the port transmission queue (for the given link). Packets arriving while a port is in sleep mode are buffered to be transmitted when the sleep period is over. Another method called Buffer-and-Burst (B&B) buffers packets at network edge routers in order to enable some of the routers inside the network to sleep [19]. With B&B, each ingress router of the network buffers packets for a certain time interval, and then bursts the entire buffer into the network. This enables all the egress routers to sleep between bursts. The most recent coalescing method for wired links is (unsynchronized) packet coalescing for EEE [6]. Packet coalescing for EEE is comparable to receive side coalescing [17], which is already in use in many Ethernet NICs. Receive side coalescing reduces the interrupt overhead on the main CPU by issuing one interrupt per many received packets instead of one for each packet. Our work builds on previous work in packet coalescing for EEE by extending the energy saving opportunity from the Ethernet link to both the link and within the switch. VII. SUMMARY AND FUTURE WORK We have shown how periodically powering down the com- ponents of a SOHO Ethernet switch after pausing the traf,c from all the connected links in a synchronized manner can reduce the power use of the switch to almost proportional to the offered load. We have also shown that by using adaptive coalescing with a suitable threshold, power use of close to load-proportional is achievable with an average delay of less than half that of the human response time (of 100 ms). Moreover, we have shown that adaptive coalescing introduces virtually no added delay to ,le transfer over TCP by keeping the switch ON for the entire ,le down- load time. Based on our results, we believe that adaptive coalescing is a viable method for signi,cantly reducing the energy consumption of Ethernet switches without an excessive performance penalty. Since the aggregate load on a SOHO Ethernet switch is typically very low, we assumed the average aggregate utilization of all links to be 7 to 10% on average. Based on the results shown in Figure 8, about 80% OFF time can be achieved in a LAN switch using adaptive coalescing at these loads. Using the power consumptions in ON and OFF states, and the total number of SOHO switches estimated in Section I, we estimate the potential energy savings that can be obtained by deploying adaptive coalescing on all the future SOHO switches to be approximately 3.5 TWh/year in the U.S. alone. As future work we need to consider: • Measuring the effects of synchronized coalescing on interactive applications (such as gaming) and web surf- ing. • Analytical and simulation evaluation of synchronized and adaptive coalescing when it is extended to multiple hops at the same time. 第 30 页 共 51 页 陕西理工学院毕业设计 ACKNOWLEDGMENT This material is based on work partially supported by Cisco Collaborative Research Initiative (Mostow,). We also thank the anonymous reviewers for their insightful com- ments that have resulted in signi,cant improvements to this paper. REFERENCES [1] J. Aweya, D. Montuno, and M. Ouellette, “Limitations of current Ethernet switch architectures for enhanced ,ow control and service differentiation,” Intl. J. of Network Management, vol. 19, pp. 153-174, May 2009. [2] J. Baliga, K. Hinton, and R. Tucker, “Energy consumption of the Internet,” Proc. COIN/ACOFT, Jun. 2007. [3] F. Blanquicet, “PAUSE Power Cycle: A new backwards compatible method to reduce energy use of Ethernet switches,” White paper, Ethernet Alliance, Apr. 2008. [4] R.Bolla, R. Bruschi, A. Carrega, and F. Davoli, “Theoretical and technological limitations of power scaling in network devices,” Proc. ATNAC, pp. 37-42, Oct./Nov. 2010. [5] Broadcom Corporation, “8-GE port switch with integrated SerDes,” BCM5398 Datasheet, 2006. [6] K. Christensen, P. Reviriego, B. Nordman, M. Bennett, M. Mostow,, and J. Maestro, “IEEE 802.3az: The road to Energy Ef,cient Ethernet,” IEEE Communications, vol. 48, no. 11, pp. 50-56, Nov. 2010. [7] G. Epps and A. Baldini, Talk in Cisco Green Research Symposium, Mar. 2008. [8] R. Fahad, P. Dogar, and K. Papagiannaki, “Catnap: Exploit- ing high bandwidth wireless interfaces to save energy for mobile devices,” Proc. 8th MobiSys, 2010. [9] M. Gupta, S. Grover, and S. Singh, “A feasibility study for power management in LAN switches,” Proc. 12th IEEE ICNP, pp. 361-371, Oct. 2004. [10] M. Gupta and S. Singh, “Dynamic Ethernet Link Shutdown for power conservation on Ethernet links,” Proc. IEEE Intl. Conf. on Communications, Jun. 2007. [11] M. Gupta and S. Singh, “Greening of the Internet,” Proc. ACM SIGCOMM, pp. 19-26, Aug. 2003. [12] IEEE P802.3az, Energy Ef,cient Ethernet Task Force, 2010. [13] IEEE Std 802.11, “Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) speci ,cations,” 1999. [14] IEEE Std 802.3x, “Standards for Local and Metropolitan Area Networks,” 1997. [15] T. Karagiannis, M. Molle, M. Faloutsos, and A. Broido, “A nonstationary Poisson view of Internet traf ,c,” Proc. IEEE INFOCOM, Nov. 2004. [16] W. Leland, M. Taqqu, W. Willinger, and D. Wilson, “On the self-similar nature of Ethernet traf,c,” IEEE/ACM TON, vol. 2. pp.1-15, Feb. 1994. [17] S. Makineni et al., “Receive side coalescing for accelerating TCP/IP processing,” Proc. 13th HiPC, Dec. 2006. [18] R. Myslewski, “Intel dubs 2009 ‘The year of 10Gb Ether- net’,” The Register, Mar. 2009. [19] S. Nedevschi, L. Popa, G. Iannaccone, S. Ratnasamy, and D. Wetherall, “Reducing network energy consumption via rate-adaptation and sleeping,” Proc. NSDI, Apr. 2008. [20] H. Newman, “Falling 10GbE prices spell doom for ,bre channel,” EnterpriseStorageForum.com, Jun. 2009. [21] The Network Simulator – ns-2, 2008. URL: [22] B. Nordman, Talk in EEDN PAC meeting, California Energy Commission, Sep. 2009. [23] V. Paxson, “Some perspectives on the performance impact of link-speed switching outages,” Presentation at IEEE 802.3 meeting, Jul. 2007. [24] C. Poellabauer and K. Schwan, “Energy-aware traf,c shap- ing for wireless real-time applications,” Proc. 10th IEEE RTAS, pp. 48-55, May 2004. 第 31 页 共 51 页 陕西理工学院毕业设计 [25] P. Reviriego, J. Hernandez, D. Larrabeiti, and J. Maestro, “Performance evaluation of Energy Ef,cient Ethernet,” IEEE Communication Letters, vol. 13, no. 9, Sep. 2009. [26]USAQuickFacts from the U.S. Census Bureau, URL: 文献翻译: 在局域网交换机节能: 以太网节能的分组合并新方法 Mehrgan Mostowfi和Ken Christensen 计算机科学与工程系 南佛罗里达州大学 坦帕,佛罗里达州 {mostowfi, christen}@cse.usf.edu 在美国~以太网交换机每年就在家居办公,SOHO,中消耗大约8太瓦时电。尽管交换机通常都是处于 [摘要] 低流量负载和大量的闲置时期~但一般在任何时候这些开关都保持满电。根据以太网节能,EEE,的标准~在空闲时间即没有数据传输时~以太网接口可以进入低功耗空闲,LPI,。本文提出并评估了一个新的EEE策略~即在网路主机和边缘路由器上~同步合并数据包。这一策略为局域网交换机的所有端口提供了充足的空闲期~从而仅在以太网PHY中深化节约能源。我们使用NS-2仿真型的局域网交换机来评估我们的方法。我们将展示在引入受限制和控制影响的特殊互联网流量和TCP的同时~可以减少局域网交换机40%的整体能源使用的方法。 [关键词] 以太网交换机,凝聚,节能以太网,绿色互联网 一、引言 在2008年,美国网络电子设备消耗将近4%(150TWh)的电力,其中大约13%(20TWh)都[ 22 ]消耗于类似网络交换机和路由器的网络设备。以太网,作为占主导地位的有线局域网技术,是计算机网络能源利用的一个重要部分。作为降低以太网能耗的最新进展,在2010年九月以太网节能[12 ](EEE)的标准化,即IEEE Std 802.3az-2010。在2011月中下旬,使用Eee标准的产品开始生产。EEE使以太网链路在空闲时退出主动模式和进入低功耗空闲(LPI)模式。当物理层(PHY)的一些组件可以关闭的时候,用于LPI模式的功率是显著小于在主动模式的。IEEE 802.3az标准是不描述 。当数据包在传输队列中排队的接口时,一个简单的策略会进入活跃进入和退出低截获概率的策略 模式,而输入队列为空时则进入低截获概率模式。这样的策略已被发现是无效的(即,浪费能量)[ 25 ]由于活性和低截获概率模式之间的过度的转换。每个过渡会产生延迟和能源使用。 [ 6 ]一个由克里斯坦森等人在2010年提出并探索的间歇,或合并数据包方法。可提高能源效率的主机的以太网接口以及以太网交换机。一个开关的整体能源消耗降低EEE中由于开关的各个接口的能量消耗减少。然而,我们相信通过EEE节能可以超越个人储蓄在接口如果所有的交换机端口同时进入低截获概率模式,或同步。同步LPI时期为功率开关的附加组件的机会下来因为它一定会有任何端口缓冲区没有包,或在交换机上,需要转发。在同步联合控制时,合并和多长时间移到开关(从主机接口)和聚结时间同步所有的交换机端口。我们的目标凝聚法同步开关主要用于家庭和小型办公室的人。这种类型的开关,这被称为SOHO(家居办公)开关以后,通常包括4到10端口的[ 9开关的典型的低利用率]成本不到100美元。两个因素促使我们提出了同步合并。首先是在一般的。第二,虽 第 32 页 共 51 页 陕西理工学院毕业设计 然以太网SOHO交换机只消耗少量能源独立,它们的数量在全国部署是如此之高,这使他们的消费明显甚至小有积蓄,每开关将添加到一个显着的总储蓄。使用kill-a-watt功率计,测量为10 W,我们估计,SOHO的以太网交换机的电流消耗约7.9亿千瓦时/年,基于美国[ 26 ]房屋的数量是4连接的活动链接的Linksys的eg005w千兆以太网交换机的电源使用,假设有70%个以太网交换机安装,并且每个开关电源,所有的时间。在目前的平均发电成本(0.10美元/千瓦时)这是一个共约790000000美元,每年用电量。虽然目前的以太网链路和交换机都是100 Mb / s和1 GB / s,我们设想,他们可能演变为10 GB / s的在不久的将来的几个原因,包括 [ 20 ] 1)价格不断下降, [ 18 ] 2)快速通过由供应商,和 3)不断增长的带宽需求的多媒体应用在家庭内部(例如音频/视频传输存储设备和球员之间,和基于局域网的多玩家游戏)。本文的贡献是提出和同步凝聚并通过仿真对其性能的权衡和典型的互联网流量和TCP效果评价的解释。本文的其余部分组织如下。第二部分回顾了EEE和以前的工作已经完成,在政策控制设备。第三节提出了SOHO的以太网交换机和关闭单个组件的机会用电的微观研究。第四部分介绍了新的同步融合方法。第五部分是方法的仿真评价。第六章介绍了相关的工作。第七节总结,描述了未来的工作,和估计的潜在的能源节约,可以通过该方法获得的大规模部署。 II。高效节能以太网(EEE)概述 EEE带来的以太网链路接近理想的消费的能源消耗,这对链路利用率成正比。估计表明,使用易在目前所有的1 GB / s在住宅和商业在住宅建筑和网络设备的链接可以节省大约180000000美元/[ 6 ]年,仅在美国,边缘链接。两种模式中定义的Eee;主动模式和低功耗空闲(LPI)模式。在主动模式下的链路上电来传输数据包。当没有更多的数据包要发送的链接,可以进入低截获概率模式中的物理层断电,在接收器的元素都停止了。一个数据包的到达的链接可链接醒来在几微秒的恢复数据包传输(图1)。在这个图中,TS是时间需要进入低截获概率模式和TW是需要返回到主动模式[ 25 ]的时间。在台湾,TS和TR时期的链路消耗全功率,而在TQ只有近10%的链接的全功率消耗需要。时间TR刷新周期是一个周期性的活动环节保持接收器元件的对齐到信道条件。它可以假定链路使[ 25 ]用相同的权力,在主动模式转换中。10GBASE-T标准链接最小TW和TS分别是4.48和2.88μ[ 12 ]s。转换时间是相对比较高的1.2μs传输时间的一个1500字节的数据包在10 GB /秒 A.提高设备效率 相比于一个数据包的传输时间和过渡时间大。例如,如果链接醒来发送一个1500字节的数据,它将用1.2μs转发的包和7.38μs的过渡模式向主动回LPI。这意味着,只有大约14%的时间致力于[ 25 ]传输数据包和其他的转换。这种低效率的Eee是由reviriego等人首先探讨。 2009。EEE可以最有效的数据包到达时背爆发。作为一个结果,只有一个睡眠和唤醒过渡是每爆裂使时间的接口在主动模式接近链路利用率的要求。这最好的情况经常发生在文件下载使用TCP在大的数据块被冲进一个链接从一个服务器到客户端在高速率的形式。相反,最坏的情况发生,当数据包到达一个固定的到达时间间隔和间距大于清醒和睡眠的过渡时间。作为一个结果,一个唤醒和睡眠的过渡将为每个数据包导致低效的操作的传输要求。一个接近最坏情况下的交通场景中发生时,TCP ACK正在从客户端返回服务器。TCP ACK数据包,是典型的小间距均匀(图2)。EEE的效率可以由联合传出的[ 6 ]数据包到阵阵减少必要的转换次数减少到每一个爆裂。分组合并的Eee证明和研究。EEE具有分组合并的是图3所示。在这个图中,当所有的数据包发送队列中(或缓冲液)传输和缓冲区为空,链接是放低截获概率模式以时间后睡眠过渡。数据包到达后不立即发送到一个凝聚而进行缓冲缓冲区。当一个最大时间从第一包的到达凝聚的缓冲区,或缓冲的数据包的数目达到一个预定义的最大的环节,存在低截获概率的方式,以台湾时间。所有的合并在一个单一的突发传输的数据包。刷新周期图3略,TQ > >翻译 三、开关的能源使用和过渡时期 从一个开关之间的所有端口LPI周期同步确定可能的节约能源,必须回答以下三个问题: 1)组成的开关可关闭, 第 33 页 共 51 页 陕西理工学院毕业设计 2)在总开关电源使用多少的减少可以通过关闭这些组件实现, 3)所需的时间过渡这些组件完全供电断电模式,后面是什么, 一个典型的SOHO以太网交换机的主要成分是单芯片CMOS开关。dgs-1008g友讯,Linksys的eg008w,网件GS608,和趋势S8的TEG这种开关的常见例子(都是千兆以太网交换机)。首先[ 27 ][ 5 ]采用Vitesse vsc7388 sparx-g5 ,和其他使用博通bcm5398芯片,这两者都是单片交换芯片,包括交换结构,以太网接口模块,外部接口的CPU,存储器,和2层数据包报头处理器。芯片连接到铜接口和可选的外部存储器和CPU。交换结构是一种高性能的总线,所有的端口模块和处理器之间共享。每个端口模块由一个铜PHY,MAC和入口和出口的包队列。数据包的转发表保存在处理器的存储器和寄存器。通过PHY接口输入数据包,通过对MAC,放在端口阻塞的队列,然后穿上公共汽车。该数据包的报头由包处理器和转发端口被确定了,或是过滤。转发表进行相应的修改在这一点上,如果需要的话。该数据包然后放在转发端口的输入队列。然后通过MAC和PHY的输出接口。我们相信,一个同步的空闲时间可以使开关芯片,同时保持内部状态的睡眠。然而重要的是,,清空所有的入口和出口队列断电为了不丢失任何数据包之前。这回答问题1。回答问题2,一个10 GB / s以太网SOHO交换机必须首先确定用电。由于这种开关还可以生产和销售SOHO使用,我们估计他们的权力使用,如下。我们测量了Linksys的eg005w千兆交换机的平均功率使用4活动链接10 W.我们设想10 GB / s的开关成为司空见惯的10GBASE-T标准2016左右,大约10年后,这是从千兆以太网标准相同的时间跨度在1999到1 GB / s的成为2009现状。采用100 W的消耗为基础(容量[ 2 ]增加的线性关系)和路由器的电源效率 20%年度的改善,在未来10年内现状开关电源的使用将约[ 7 ] 10 W(就是说,今天的一样)。对高端企业级路由器线卡的CPU和存储器的消耗超过线卡功率50%。我们假设故障的电力使用10 GB / s的SOHO交换机将大致对应于一个单一的故障线路卡一个企业路由器与CPU和记忆植入芯片的开关。因此,我们认为,通过关闭芯片的总功率的使用减少到50%的整体。回答问题3,我们使用C0和一个英特尔酷睿i5处理器核C6状态之间的过渡时间(2毫秒) [ 4 ]作为一个保守的上限的过渡时间为芯片和可能的外部CPU。同步LPI周期应至少两次这样的时刻让芯片到全功率状态到低功耗状态和过渡。 四、同步凝聚法 在同步合并,所有的链接,连接到一个局域网交换机是停在一段固定的时间,同时发送任何交通。在两个网络接口端进入低截获概率模式自动,和先前描述的组件的局域网交换机可以关闭或进入睡眠模式。同步合并是专为以太网SOHO交换机由于这是最轻松的利用开关网络中有许多空闲时间。因此,有节约能源的一个很好的机会,在这些开关的同时最大限度地减少对网络性能的任何可能的不利影响。同步合并建立在暂停动力循环(PPC)的思想,提出了原型的EEE的标准化之前的[ 3 ]2008 。图4显示了一个高层次的系统视图的同步融合的作品。这是类似于[ 3 ]的配置。同步凝聚在局域网交换机和完成的工作如下:通知消息(简称暂停通知以下)表示该接口连接到端口必须不能发送任何交通任意区间被打开的所有端口。开关然后进入低功耗模式,即前面提到的组件是关机或进入休眠状态。当时间流逝,开关功率高达一个全面运作的状态和恢复服务包(状态)。时间,开关在OFF和ON状态分别叫托夫和吨。基于托夫和吨,一个称为占空比参数(D)被定义为吨/(吨+ 下降沿触发)。通过固定托夫和D,吨可确定为(D?下降沿触发)/(1?D)。一个可以用来通知网卡停止发送任何交通一段时间的机制是,流量控制机制被称为以太网标准定义的PAUSE帧。然而,交通停止部分同步合并可以使用其他的通知机制,很好的实现。实施同步合并房开关需要某种暂停通知支持MAC或PHY层。暂停帧通知网卡暂时停止交通,OW(除了MAC控制帧)一段时间[ 14 ]。暂停帧的目的是允许一个连接端通过暂时停止的另一端发送更多的数据包从一个拥挤的状态恢复。通过设置MAC控制参数场托福价值,暂停帧可以用来确保没有交通将受到断电不会造成数据包丢失。 A.简单同步凝聚最简单的版本同步合并是当开关状态停留在一段固定的时间,进入了状态,在一段固定的时间和重复的过程。简单的同步合并由一个有限状态机(FSM)图5。开关是完全可操作的状态,而连接到开关的环节都停了下来,开关断电(睡眠)在关闭状态。定义了两个定时器;上升沿触发和下降沿触发,维持的时间花在和关闭状态。对定时器的初始值是上升沿触发和下降沿 第 34 页 共 51 页 陕西理工学院毕业设计 触发,分别。 B.自适应合并使用简单的同步融合结果在大增加每包延迟尤其是当链路上的总负荷高或突然爆发的包,如何开关。这种影响将被证明和第五部分来减少这种影响进一步解释,简单的修改同步凝聚了对关闭状态,根据接收的数据包在以前的状态的过渡。简单的同步相结合这一修改被称为自适应合并以后。自适应合并是在图6中的FSM描述。这具有相同的状态,如图5中的有限状态机。一种新的阵列和一个新的变量的定义如下:•pktcount:的大小等于连接到交换机连接数的数组。对pktcount店从相应的链路接收的数据包的数目的每个元素。我是为pktcount指数范围从1到链接的数量。•阈值:阈值相比较,最大允许所有pktcountis是否应该关闭状态过渡。在启动或复位,开关进入状态,吨设置为其初始值吨,开始倒计时。同时,对pktcount所有元素都初始化为0。当吨过期,两种情况发生:1)在pktcount所有元素的最大值大于或等于阈值(这个处理负载均匀分布在所有的端口,以及一个单端口重交通或突发),其中暂停通知发送的所有链接,其中复位,开始倒计时,开关进入关闭状态,或2)否则;在这种情况下,吨重置为其初始值开始倒计时,pktcount的所有元素都设置为0和开关保持在国家一期。到期名士,吨重置为其初始值开始倒计时,pktcount的所有元素都设置为0,开关返回状态,整个程序重复。 五、通过模拟评价 [ 21 ] 我们评估了节能和性能的权衡我们的贸易方法使用NS-2仿真模型。模型同步凝聚在NS-2我们添加了两个定时器的有线局域网网络PHY模块停止和恢复传递包的低层为固定的时间。我们同步和关闭期间在所有所有的物理共享使用静态变量在一个局域网的连接。系统配置的实验因素进行带宽和服务器的边缘路由器的RTT,开关边缘路由器和交换机连接,客户端的链接。traffic ,ows的因素是数据流任意分组,型分布或FTP。同步和自适应压缩的因素是toff,D,和阈值。响应变量的开关时间,下载时间(文件传输),和平均分组延迟(任意分组分布,OWS)。从开关时间,节约能源可以计算。 A.实验设计建立在图4所示为我们所有在NS-2仿真实验的网络配置。服务器和边缘路由器是由一个模拟连接的RTT连接100μs。在传输协议TCP拥塞窗口的大小,最大的60包是用对应的默认最大TCP窗口大小在大多数微软Windows分布。交换机和边缘路由器在同一个局域网的2μRTT。客户和开关是在另一个局域网具有相同的2μ的RTT。这大致相当于一个局域网的客户边缘路由器,交换机和位于同一建筑。我们寻求与一个同步联合仿真模型实验评价回答以下问题: 1)如何同步联合处理高流量负载和突发包爆发, 2)如何影响参数的自适应混合开关的时间吗, 3)的性能折衷的自适应融合是什么, 4)如何影响真实自适应合并应用如文件下载, 设计了三个实验: 1)高负荷影响的实验, 2)阈值的试验,和 3)文件下载试验。 每个实验的目的是要回答上述问题。高负荷影响的实验。这个实验是去签署研究表现在高负载和数据包突发同步合并(问题1)。包,流从客户端1在UDP开关。数据包到达间隔时间服从指[ 16 ]数分布。在大的时间尺度上的自相似网络流量很可能,然而一个泊松分布的情况下,交通仍然是[ 15 ]高度集中的,交通的样本是在子二采取合理的一阶近似(小)的时间跨度。的数据包的大小是固定的1500个字节(最大以太网的MTU,桥接/ 1 GB / s的兼容的交换系统)。简单的同步合并被启用的开关在10%和50%两个工作周期。toff是固定在100自100毫,大约是人类的反应时间,这可能是可以容忍的延迟上界。一个toff的100毫秒限制转换的相对时间和由此产生的能源浪费,小于2%的睡眠时间。提供的负载被操纵的数据包的平均到达间隔时间的变化。感兴趣的响应变量的开关时间和平均分组延迟。阈值实验。本实验的目的是研究影响的阈值用于自适应合并对数据包的延迟和开关电源使用(问题2和3)。一个包,OW(指数到达间隔时间)从服务器到客户端的UDP 1与一个固定的数据包大小为1500字节的变负载被建模为在以前的实验。有钱人再次被固定为100 MS 第 35 页 共 51 页 陕西理工学院毕业设计 自适应凝聚在10%工作周期的开关启用。使用两个阈值1000和5000包。前者(低门槛)对应于近10%的链路容量(相当于占空比)。后者(高阈值)几乎一半的链路容量。感兴趣的响应变量的开关时间和平均分组延迟。文件下载实验。本实验旨在研究托夫和自适应合并阈值对TCP的下载文件的影响(问题4)。一个125字节的文件(对应于一个小的视频文件的大小)是由客户端下载1使用FTP服务器。自适应合并是一个10%占空比的开关启用。三个自适应压缩阈值的100,500和1000包是用来显示不同的阈值对响应变量的影响。toff是不同的覆盖范围从0到超过100的女士感兴趣的响应变量的文件下载时间和开关时间。 B.实验结果和讨论实验结果如下。对于高负载效应实验的平均分组时延和链路上的功能提供负载如图7所示。可以观察到,当载荷超过占空比,平均延迟开始迅速增加,由于缓冲区队列的稳定性。请注意,数据包被连接到开关的NIC延迟,不在开关。这是由于传输期间暂时停止从Toff时间而包仍在产生的网卡。如果在交通突发同样的现象发生,虽然整体荷载小于循环。跳过周期自适应合并是为了克服这一缺点的有效途径的门槛。开关时间的占空比相同,无论负载。图8中的阈值的实验结果表明,时间花在开关状态作为一个功能的负荷比例。利用高阈值,对开关时间小于负载比例为开关时间的理想10%个不同。然而,关于时间是当低阈值方法。采用低阈值,当负荷超过占空比(10%)在时间上很快到100%,保持在这一水平载荷的增大而增大。这突然的增加是由于到达的数据包的数量在期间超过阈值。“步骤”中看到的痕迹 也因为到达的数据包的数量超过阈值。在指出时间增加到下一步,数据包到达时的一些时期超过阈值的数量。在每增加一个给定的步骤,在保持大致相同的时间,直到一个新的台阶下增加。这是因为当到达的数据包的数目增加,增加不高造成任何更多的时期有更多的到达的包比阈值。因此,对时间不在这些中间负荷的变化。虽然自适应合并带来的时间接近负荷比例,介绍了一些数据包延迟。原因是,开关有时无法服务包,而包保持到连接的设备的开关。这些数据包排队和延误。图9显示了通过自适应压缩为两个阈值函数提供负载所造成的数据包的平均延迟。步骤也看到这个数字随着负载的增加。每一步对应于图8中的时间步长。原因是所描述的在同一时间。平均每包延迟小于人体反应时间的一半(50毫秒)具有非延迟敏感的应用[ 23 ]轻微的负面影响。采用低阈值时会发生数据包到达在周期数超过阈值,不断在10%负载延迟的突然下降,使开关保持服务包立即。如果没有合并使用,这将需要1到1 GB / s的带宽下载整个125字节的文件(链接的边缘路由器和服务器通过网络之间)。图10显示了下载时间的文件为下载的文件使用简单的同步实验凝聚和自适应相结合的10%占空比和三的阈值时。使用简单的同步相结合的10%占空比如开关的容量减少到了10%,这使得开关容量链接等于服务器的带宽通过互联网(1 GB / s)。这个建议在文件下载时间没有增加。然而,它是在图10中,这是唯一的情况下当toff是非常小的(小于3μs看到的) 为toff增加下载时间成倍增加,直到它变得稳定在10左右,对边缘路由器和服务器之间的链路容量的十分之一。我们的模拟仪表显示,这种违反直觉的效果是由于副作用的TCP拥塞控制机制。如果有钱人比需要发送一个拥塞窗口的时间较长,从服务器传输暂停,直到窗口释放在期下。这种效应可以通过减少电子控制。正如在第三节,然而,其中不能设置为小于4毫秒,由于过渡时间。太小的电子时代,虽然超过最低,大大增加的功耗,由于相对高的过渡时间。 调整阈值相反,可以用来控制这暂时的效果而不牺牲其中有益的长度。如图10所示,如果阈值被设置为大致的数据包可以传送在全速率在一吨的数量相同,(比如100包10%个,占空比10毫秒和1.11吨MS TOFF)超过该阈值在文件下载的情况下,使传输时间,它会如果没有使用合并的方法是一样的。作为一个结果,开关将保持在整个下载时间,如图11所示。图11显示的开关时间花费在国家对该文件的完整的FTP下载结束时间函数的toff的百分比。三个相同的阈值,如图10所示。正如预期的那样,保持切换为时间当阈值是比什么传播在关闭期间10%。当超过该阈值时,开关处于不断。从我们的实验结果,似乎自适应合并可以节约大量的能源在10 GB / s的只有很小的权衡性能降低,符合下列条件的SOHO以太网交换机: •占空比(D)的值被设置为使开关花大部分的时间在关闭状态。•控制变量toff是设置为小于人的响应时间和相当多的开关转换时间。•阈值(阈值)的值被设置为检测文件传输和阵阵好。我们提出了10%,100毫秒,1000包为D,toff,和阈值分别,显示这些值Pro提供约80%的睡眠时间的 第 36 页 共 51 页 陕西理工学院毕业设计 开关,同时引入一个小的性能下降(小于50毫秒的平均包延迟和一个与减少能源节约费用的突发流量突发的情况下几乎没有减少)。 六、相关工作包括一个凝聚法节能的目的是在20世纪90年代后期在无线网络的第一标准。 1999,省电机制(PSM)的分布式协调功能(DCF)在IEEE 802.11无线网络标准化[ 13 ]。在PSM,时间被分成相等的信标间隔。数据包发往无线站合并在前一站到他们第一信标间隔期间发送。提出了改进的PSM改性聚标准在特定条件下或某一特殊类型的交通改善其性能([ 24 ]为例)。最近[ 8 ]的合并方法的无线移动设备是瞌睡。打瞌睡了代理的无线路由器连接移动设备和跨网。代理收集传入的数据包和爆发他们在预定的时间间隔的装置让睡眠之间爆发的无线装置。在减少能源使用有[ 11 ]线网络的研究开始于本世纪初。首次提出利用分组合并减少能源使用的是动态的以太网交换机的[ 10 ]以太网链路关机(德尔斯)。模式决定睡眠的LAN端口基于数据包已经缓存在端口传输队列的统计(对于给定的链接)。到达的数据包,而港口是在睡眠模式下的缓冲被传输的睡眠周期结束时。另一种方法称为缓冲和突发(B & B)缓冲数据包在网络的边缘路由器,以使里面的一些网络路[ 19 ]由器的睡眠。B & B,每个入口路由器的网络缓冲区的数据包间隔一定时间,然后突然整个缓冲区网络。这使得所有的出口路由器之间爆发的睡眠。最近的合并方法有线链接(非同步)分组[ 6 ][ 17 ]合并的Eee 。分组合并的Eee与接收端合并,它已被使用在许多以太网卡。接收端可减少中断开销在主CPU发出一个中断每多接收的数据包而不是每一个包。我们的工作建立在以前的 在分组合并的Eee延长节能机会从以太网链路的链路和交换机内的工作。 七。总结和未来的工作, 我们已经展示了如何定期关闭一个以太网SOHO开关部件后暂停交通从所有连接在一个同步的方式可以减少开关电源的使用几乎正比于负载。我们还表明,利用自适应合并与一个合适的阈值,接近负荷比例功率的使用是有不到一半的人响应时间平均延迟可以实现的(100毫秒)。此外,我们已经表明,自适应融合了几乎没有增加延迟文件传输的TCP保持开关在整个文件加载时间。根据我们的结果,我们认为,自适应合并是显著降低了以太网交换机的能源消耗而没有过多的性能损失的一种可行方法。由于在SOHO以太网交换机的负荷通常是非常低的,我们假设所有的链接有7到10%的平均平均综合利用。基于结果如图8所示,约80%的时间可以在使用自适应凝聚在这些荷载的LAN交换机的实现。使用的功率消耗在ON和OFF状态,SOHO交换机和估计在第一节的总数,我们估计潜在的能源节约,可以通过部署自适应合并所有未来SOHO交换机是仅在美国获得约3.5亿千瓦时/年。未来的工作需要我们去考虑: •测量同步结合交互式应用的影响(如游戏)和上网。 •解析和仿真评价同步和自适应压缩当它扩展到多跳的同时。 确认这种材料是基于工作由思科的合作研究计划,部分支持(Mostowfi)。我们也感谢匿名审稿人的洞察力,这已经导致了本文显着的改善。 引用 [ 1 ] J. D. aweya,montuno,和M.韦莱,“增强,流量控制和区分服务当前以太网交换机体系结构的局限性,“国际J.网络管理,Vol. 19,pp. 153-174,可能2009。 [ 2 ] J. K. Baliga,Hinton,和R.塔克,“互联网的能源消耗,”过程。硬币/ acoft,6月2007。 [ 3 ] f. blanquicet,“暂停动力循环:减少ethernetswitches能源使用一个新的向后兼容的方法,”白皮书,以太网联盟,4月2008。 [ 4 ] r. bolla,R. Bruschi,A.卡雷加,F. davoli,”理论和技术的电力网络设备中的比例限制,”过程。ATNAC,页37-42,十月/十一月2010。 [ 5 ]博通公司,“集成SerDes 8-ge端口开关,“bcm5398数据表,2006。 [ 6 ]克里斯坦森,P. reviriego,B.诺德曼,M.班尼特,M. Mostowfi,和J.大师,”IEEE 802.3az:节能以太网的道路,”IEEE通讯,48卷,11号,第50-56,11月2010。 [ 7 ]埃普斯和A.巴尔迪尼,思科绿色研讨会说,3月2008。 [ 8 ] r.法赫德,P和K Dogar,papagiannaki,“打瞌睡:利用高带宽的无线接口的移动设备,节约能源,”过程。第八MobiSys,2010。 第 37 页 共 51 页 陕西理工学院毕业设计 [ 9 ] M. Gupta,S.格罗弗,S.辛格,“在局域网交换机的电源管理的可行性研究,”过程。第十二届IEEE国际361-371,PP,10月2004。 [ 10 ] M. Gupta和S.辛格,对以太网链路功率守恒动态以太网连接关闭,”过程。IEEE国际会议上交流,2007六月。 [ 11 ] M. Gupta和S.辛格,“互联网的绿化,”过程。ACM SIGCOMM,第19-26,8月2003。 [ 12 ]IEEE p802.3az,节能以太网工作组,2010。 [ 13 ]IEEE 802.11,无线局域网的介质访问控制(MAC)和物理层(PHY)规范,“1999。 [ 14 ]IEEE 802.3x,“局域网和城域网标准,“1997。 [ 15 ] T. Karagiannis,M. M.踯躅,加拿大,和A. Broido,“互联网流量的非平稳泊松过程的观点,”。IEEE INFOCOM,11月2004。 [ 16 ]利兰,M. taqqu,W和D Willinger,威尔逊,在以太网流量的自相似性,”IEEE / ACM吨,卷2。pp.1-15,2月1994。 [ 17 ]美国makineni等人。,“接收端的TCP / IP可加速处理,”过程。第十三个重债穷国,12月2006。 [ 18 ] r. myslewski,“英特尔2009”称为10GB以太网”的一年,“登记册,3月2009。 [ 19 ]美国nedevschi,L.波帕,G. Iannaccone,美国ratnasamy,和D.韦瑟罗尔,“通过速率自适应和睡眠减少网络的能量消耗,”过程。NSDI,4月2008。 [ 20 ] H. Newman,“价格下降意味着万兆以太网光纤通道,“enterprisestorageforum.com,6月2009。 [ 21 ]网络模拟器NS-2–,2008。网址:[ 22 ] B.诺德曼,在eedn PAC会说话,加利福尼亚能源委员会,9月2009。 [ 23 ]v.帕克森,”链接速度切换中断性能影响的一些观点,“在IEEE 802.3会议上表示,7月2007。 [ 24 ] c. poellabauer和K. Schwan,“能量感知交通形态-无线实时应用程序,”。第十IEEE第48-55页,2004五月。 [ 25 ] p. reviriego,J.埃尔南德斯,D. larrabeiti,和J.大师,“节能以太网的性能评价,”IEEE通信 ,9号,9月2009。 信件,卷13 [ 26 ]美国概览来自美国人口普查局,网址: 第 38 页 共 51 页 陕西理工学院毕业设计 附录B 系统电路仿真原理图 图A 主机原理图 第 39 页 共 51 页 陕西理工学院毕业设计 图B 分机电路原理图 第 40 页 共 51 页 陕西理工学院毕业设计 附录C PCB版图仿真图 图C 主机版图 图D 分机版图 第 41 页 共 51 页 陕西理工学院毕业设计 附录D 电路实物图 图E 主机实物电路(正面) 图F 主机实物电路(反面) 第 42 页 共 51 页 陕西理工学院毕业设计 图G 分机实物电路(正面) 图H 分机实物电路(反面) 第 43 页 共 51 页
/
本文档为【一种节能型网络交换机的设计毕业论文】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索